annotate ppc/dsputil_ppc.h @ 3036:0b546eab515d libavcodec

Update licensing information: The FSF changed postal address.
author diego
date Thu, 12 Jan 2006 22:43:26 +0000
parents bfabfdf9ce55
children c8c591fe26f8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
1 /*
1949
66215baae7b9 hadamard8_diff8x8 in AltiVec, the 16bits edition by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1578
diff changeset
2 * Copyright (c) 2003-2004 Romain Dolbeau <romain@dolbeau.org>
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
3 *
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
4 * This library is free software; you can redistribute it and/or
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
5 * modify it under the terms of the GNU Lesser General Public
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
6 * License as published by the Free Software Foundation; either
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
7 * version 2 of the License, or (at your option) any later version.
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
8 *
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
9 * This library is distributed in the hope that it will be useful,
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
12 * Lesser General Public License for more details.
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
13 *
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
14 * You should have received a copy of the GNU Lesser General Public
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
15 * License along with this library; if not, write to the Free Software
3036
0b546eab515d Update licensing information: The FSF changed postal address.
diego
parents: 2979
diff changeset
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
17 */
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
18
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
19 #ifndef _DSPUTIL_PPC_
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
20 #define _DSPUTIL_PPC_
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
21
1340
09b8fe0f0139 PPC fixes & clean-up patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1334
diff changeset
22 #ifdef CONFIG_DARWIN
09b8fe0f0139 PPC fixes & clean-up patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1334
diff changeset
23 /* The Apple assembler shipped w/ gcc-3.3 knows about DCBZL, previous assemblers don't
09b8fe0f0139 PPC fixes & clean-up patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1334
diff changeset
24 We assume here that the Darwin GCC is from Apple.... */
09b8fe0f0139 PPC fixes & clean-up patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1334
diff changeset
25 #if (__GNUC__ * 100 + __GNUC_MINOR__ < 303)
09b8fe0f0139 PPC fixes & clean-up patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1334
diff changeset
26 #define NO_DCBZL
09b8fe0f0139 PPC fixes & clean-up patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1334
diff changeset
27 #endif
09b8fe0f0139 PPC fixes & clean-up patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1334
diff changeset
28 #else /* CONFIG_DARWIN */
09b8fe0f0139 PPC fixes & clean-up patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1334
diff changeset
29 /* I don't think any non-Apple assembler knows about DCBZL */
09b8fe0f0139 PPC fixes & clean-up patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1334
diff changeset
30 #define NO_DCBZL
09b8fe0f0139 PPC fixes & clean-up patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1334
diff changeset
31 #endif /* CONFIG_DARWIN */
09b8fe0f0139 PPC fixes & clean-up patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1334
diff changeset
32
1352
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
33 #ifdef POWERPC_PERFORMANCE_REPORT
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
34 void powerpc_display_perf_report(void);
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents: 2057
diff changeset
35 /* the 604* have 2, the G3* have 4, the G4s have 6,
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents: 2057
diff changeset
36 and the G5 are completely different (they MUST use
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents: 2057
diff changeset
37 POWERPC_MODE_64BITS, and let's hope all future 64 bis PPC
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents: 2057
diff changeset
38 will use the same PMCs... */
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents: 2057
diff changeset
39 #define POWERPC_NUM_PMC_ENABLED 6
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
40 /* if you add to the enum below, also add to the perfname array
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
41 in dsputil_ppc.c */
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
42 enum powerpc_perf_index {
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
43 altivec_fft_num = 0,
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
44 altivec_gmc1_num,
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
45 altivec_dct_unquantize_h263_num,
1578
6a4cfc5f9f96 AltiVec optimized fdct patch by (James Klicman <james at klicman dot org>)
michael
parents: 1352
diff changeset
46 altivec_fdct,
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
47 altivec_idct_add_num,
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
48 altivec_idct_put_num,
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
49 altivec_put_pixels16_num,
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
50 altivec_avg_pixels16_num,
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
51 altivec_avg_pixels8_num,
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
52 altivec_put_pixels8_xy2_num,
1024
9cc1031e1864 More AltiVec MC functions patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1015
diff changeset
53 altivec_put_no_rnd_pixels8_xy2_num,
9cc1031e1864 More AltiVec MC functions patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1015
diff changeset
54 altivec_put_pixels16_xy2_num,
9cc1031e1864 More AltiVec MC functions patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1015
diff changeset
55 altivec_put_no_rnd_pixels16_xy2_num,
1949
66215baae7b9 hadamard8_diff8x8 in AltiVec, the 16bits edition by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1578
diff changeset
56 altivec_hadamard8_diff8x8_num,
1951
2599b8444831 better hadamard8_diff16 in AltiVec, and more patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1949
diff changeset
57 altivec_hadamard8_diff16_num,
2057
4c663228e020 avg_pixels8_xy2_altivec in AltiVec, enabling avg_pixels8_altivec, hadamard fix by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1951
diff changeset
58 altivec_avg_pixels8_xy2_num,
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
59 powerpc_clear_blocks_dcbz32,
1334
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1045
diff changeset
60 powerpc_clear_blocks_dcbz128,
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents: 2057
diff changeset
61 altivec_put_h264_chroma_mc8_num,
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents: 2057
diff changeset
62 altivec_avg_h264_chroma_mc8_num,
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents: 2057
diff changeset
63 altivec_put_h264_qpel16_h_lowpass_num,
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents: 2057
diff changeset
64 altivec_avg_h264_qpel16_h_lowpass_num,
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents: 2057
diff changeset
65 altivec_put_h264_qpel16_v_lowpass_num,
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents: 2057
diff changeset
66 altivec_avg_h264_qpel16_v_lowpass_num,
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents: 2057
diff changeset
67 altivec_put_h264_qpel16_hv_lowpass_num,
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents: 2057
diff changeset
68 altivec_avg_h264_qpel16_hv_lowpass_num,
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
69 powerpc_perf_total
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
70 };
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
71 enum powerpc_data_index {
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
72 powerpc_data_min = 0,
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
73 powerpc_data_max,
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
74 powerpc_data_sum,
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
75 powerpc_data_num,
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
76 powerpc_data_total
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
77 };
1352
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
78 extern unsigned long long perfdata[POWERPC_NUM_PMC_ENABLED][powerpc_perf_total][powerpc_data_total];
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
79
1951
2599b8444831 better hadamard8_diff16 in AltiVec, and more patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1949
diff changeset
80 #ifndef POWERPC_MODE_64BITS
2599b8444831 better hadamard8_diff16 in AltiVec, and more patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1949
diff changeset
81 #define POWERP_PMC_DATATYPE unsigned long
1352
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
82 #define POWERPC_GET_PMC1(a) asm volatile("mfspr %0, 937" : "=r" (a))
1340
09b8fe0f0139 PPC fixes & clean-up patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1334
diff changeset
83 #define POWERPC_GET_PMC2(a) asm volatile("mfspr %0, 938" : "=r" (a))
1352
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
84 #if (POWERPC_NUM_PMC_ENABLED > 2)
1340
09b8fe0f0139 PPC fixes & clean-up patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1334
diff changeset
85 #define POWERPC_GET_PMC3(a) asm volatile("mfspr %0, 941" : "=r" (a))
1352
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
86 #define POWERPC_GET_PMC4(a) asm volatile("mfspr %0, 942" : "=r" (a))
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
87 #else
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
88 #define POWERPC_GET_PMC3(a) do {} while (0)
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
89 #define POWERPC_GET_PMC4(a) do {} while (0)
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
90 #endif
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
91 #if (POWERPC_NUM_PMC_ENABLED > 4)
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
92 #define POWERPC_GET_PMC5(a) asm volatile("mfspr %0, 929" : "=r" (a))
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
93 #define POWERPC_GET_PMC6(a) asm volatile("mfspr %0, 930" : "=r" (a))
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
94 #else
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
95 #define POWERPC_GET_PMC5(a) do {} while (0)
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
96 #define POWERPC_GET_PMC6(a) do {} while (0)
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
97 #endif
1951
2599b8444831 better hadamard8_diff16 in AltiVec, and more patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1949
diff changeset
98 #else /* POWERPC_MODE_64BITS */
2599b8444831 better hadamard8_diff16 in AltiVec, and more patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1949
diff changeset
99 #define POWERP_PMC_DATATYPE unsigned long long
2599b8444831 better hadamard8_diff16 in AltiVec, and more patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1949
diff changeset
100 #define POWERPC_GET_PMC1(a) asm volatile("mfspr %0, 771" : "=r" (a))
2599b8444831 better hadamard8_diff16 in AltiVec, and more patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1949
diff changeset
101 #define POWERPC_GET_PMC2(a) asm volatile("mfspr %0, 772" : "=r" (a))
2599b8444831 better hadamard8_diff16 in AltiVec, and more patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1949
diff changeset
102 #if (POWERPC_NUM_PMC_ENABLED > 2)
2599b8444831 better hadamard8_diff16 in AltiVec, and more patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1949
diff changeset
103 #define POWERPC_GET_PMC3(a) asm volatile("mfspr %0, 773" : "=r" (a))
2599b8444831 better hadamard8_diff16 in AltiVec, and more patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1949
diff changeset
104 #define POWERPC_GET_PMC4(a) asm volatile("mfspr %0, 774" : "=r" (a))
2599b8444831 better hadamard8_diff16 in AltiVec, and more patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1949
diff changeset
105 #else
2599b8444831 better hadamard8_diff16 in AltiVec, and more patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1949
diff changeset
106 #define POWERPC_GET_PMC3(a) do {} while (0)
2599b8444831 better hadamard8_diff16 in AltiVec, and more patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1949
diff changeset
107 #define POWERPC_GET_PMC4(a) do {} while (0)
2599b8444831 better hadamard8_diff16 in AltiVec, and more patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1949
diff changeset
108 #endif
2599b8444831 better hadamard8_diff16 in AltiVec, and more patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1949
diff changeset
109 #if (POWERPC_NUM_PMC_ENABLED > 4)
2599b8444831 better hadamard8_diff16 in AltiVec, and more patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1949
diff changeset
110 #define POWERPC_GET_PMC5(a) asm volatile("mfspr %0, 775" : "=r" (a))
2599b8444831 better hadamard8_diff16 in AltiVec, and more patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1949
diff changeset
111 #define POWERPC_GET_PMC6(a) asm volatile("mfspr %0, 776" : "=r" (a))
2599b8444831 better hadamard8_diff16 in AltiVec, and more patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1949
diff changeset
112 #else
2599b8444831 better hadamard8_diff16 in AltiVec, and more patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1949
diff changeset
113 #define POWERPC_GET_PMC5(a) do {} while (0)
2599b8444831 better hadamard8_diff16 in AltiVec, and more patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1949
diff changeset
114 #define POWERPC_GET_PMC6(a) do {} while (0)
2599b8444831 better hadamard8_diff16 in AltiVec, and more patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1949
diff changeset
115 #endif
2599b8444831 better hadamard8_diff16 in AltiVec, and more patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1949
diff changeset
116 #endif /* POWERPC_MODE_64BITS */
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2236
diff changeset
117 #define POWERPC_PERF_DECLARE(a, cond) \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2236
diff changeset
118 POWERP_PMC_DATATYPE \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2236
diff changeset
119 pmc_start[POWERPC_NUM_PMC_ENABLED], \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2236
diff changeset
120 pmc_stop[POWERPC_NUM_PMC_ENABLED], \
1951
2599b8444831 better hadamard8_diff16 in AltiVec, and more patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1949
diff changeset
121 pmc_loop_index;
1352
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
122 #define POWERPC_PERF_START_COUNT(a, cond) do { \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
123 POWERPC_GET_PMC6(pmc_start[5]); \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
124 POWERPC_GET_PMC5(pmc_start[4]); \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
125 POWERPC_GET_PMC4(pmc_start[3]); \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
126 POWERPC_GET_PMC3(pmc_start[2]); \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
127 POWERPC_GET_PMC2(pmc_start[1]); \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
128 POWERPC_GET_PMC1(pmc_start[0]); \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
129 } while (0)
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
130 #define POWERPC_PERF_STOP_COUNT(a, cond) do { \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
131 POWERPC_GET_PMC1(pmc_stop[0]); \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
132 POWERPC_GET_PMC2(pmc_stop[1]); \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
133 POWERPC_GET_PMC3(pmc_stop[2]); \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
134 POWERPC_GET_PMC4(pmc_stop[3]); \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
135 POWERPC_GET_PMC5(pmc_stop[4]); \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
136 POWERPC_GET_PMC6(pmc_stop[5]); \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
137 if (cond) \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
138 { \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
139 for(pmc_loop_index = 0; \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
140 pmc_loop_index < POWERPC_NUM_PMC_ENABLED; \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
141 pmc_loop_index++) \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
142 { \
1951
2599b8444831 better hadamard8_diff16 in AltiVec, and more patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1949
diff changeset
143 if (pmc_stop[pmc_loop_index] >= pmc_start[pmc_loop_index]) \
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2236
diff changeset
144 { \
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2236
diff changeset
145 POWERP_PMC_DATATYPE diff = \
1352
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
146 pmc_stop[pmc_loop_index] - pmc_start[pmc_loop_index]; \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
147 if (diff < perfdata[pmc_loop_index][a][powerpc_data_min]) \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
148 perfdata[pmc_loop_index][a][powerpc_data_min] = diff; \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
149 if (diff > perfdata[pmc_loop_index][a][powerpc_data_max]) \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
150 perfdata[pmc_loop_index][a][powerpc_data_max] = diff; \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
151 perfdata[pmc_loop_index][a][powerpc_data_sum] += diff; \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
152 perfdata[pmc_loop_index][a][powerpc_data_num] ++; \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
153 } \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
154 } \
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
155 } \
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
156 } while (0)
1352
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
157 #else /* POWERPC_PERFORMANCE_REPORT */
1045
c8b438ecf8f4 fix for ppc compile broken by (Romain Dolbeau <dolbeau at irisa dot fr> and Colin Leroy <colin at colino dot net>)
michaelni
parents: 1024
diff changeset
158 // those are needed to avoid empty statements.
1352
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
159 #define POWERPC_PERF_DECLARE(a, cond) int altivec_placeholder __attribute__ ((unused))
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
160 #define POWERPC_PERF_START_COUNT(a, cond) do {} while (0)
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
161 #define POWERPC_PERF_STOP_COUNT(a, cond) do {} while (0)
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
162 #endif /* POWERPC_PERFORMANCE_REPORT */
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
163
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents:
diff changeset
164 #endif /* _DSPUTIL_PPC_ */