comparison ppc/dsputil_ppc.c @ 1024:9cc1031e1864 libavcodec

More AltiVec MC functions patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
author michaelni
date Mon, 20 Jan 2003 22:50:14 +0000
parents 35cf2f4a0f8c
children b4172ff70d27
comparison
equal deleted inserted replaced
1023:e61be5796027 1024:9cc1031e1864
38 return result; 38 return result;
39 } 39 }
40 40
41 #ifdef POWERPC_TBL_PERFORMANCE_REPORT 41 #ifdef POWERPC_TBL_PERFORMANCE_REPORT
42 unsigned long long perfdata[powerpc_perf_total][powerpc_data_total]; 42 unsigned long long perfdata[powerpc_perf_total][powerpc_data_total];
43 /* list below must match enum in dsputil_altivec.h */ 43 /* list below must match enum in dsputil_ppc.h */
44 static unsigned char* perfname[] = { 44 static unsigned char* perfname[] = {
45 "fft_calc_altivec", 45 "fft_calc_altivec",
46 "gmc1_altivec", 46 "gmc1_altivec",
47 "dct_unquantize_h263_altivec", 47 "dct_unquantize_h263_altivec",
48 "idct_add_altivec", 48 "idct_add_altivec",
49 "idct_put_altivec", 49 "idct_put_altivec",
50 "put_pixels_clamped_altivec",
51 "put_pixels16_altivec", 50 "put_pixels16_altivec",
52 "avg_pixels16_altivec", 51 "avg_pixels16_altivec",
53 "avg_pixels8_altivec", 52 "avg_pixels8_altivec",
54 "put_pixels8_xy2_altivec", 53 "put_pixels8_xy2_altivec",
54 "put_no_rnd_pixels8_xy2_altivec",
55 "put_pixels16_xy2_altivec",
56 "put_no_rnd_pixels16_xy2_altivec",
55 "clear_blocks_dcbz32_ppc" 57 "clear_blocks_dcbz32_ppc"
56 }; 58 };
57 #ifdef POWERPC_PERF_USE_PMC 59 #ifdef POWERPC_PERF_USE_PMC
58 unsigned long long perfdata_miss[powerpc_perf_total][powerpc_data_total]; 60 unsigned long long perfdata_miss[powerpc_perf_total][powerpc_data_total];
59 #endif 61 #endif
63 #ifdef POWERPC_TBL_PERFORMANCE_REPORT 65 #ifdef POWERPC_TBL_PERFORMANCE_REPORT
64 void powerpc_display_perf_report(void) 66 void powerpc_display_perf_report(void)
65 { 67 {
66 int i; 68 int i;
67 #ifndef POWERPC_PERF_USE_PMC 69 #ifndef POWERPC_PERF_USE_PMC
68 fprintf(stderr, "AltiVec performance report\n Values are from the Time Base register, and represent 4 bus cycles.\n"); 70 fprintf(stderr, "PowerPC performance report\n Values are from the Time Base register, and represent 4 bus cycles.\n");
69 #else /* POWERPC_PERF_USE_PMC */ 71 #else /* POWERPC_PERF_USE_PMC */
70 fprintf(stderr, "AltiVec performance report\n Values are from the PMC registers, and represent whatever the registers are set to record.\n"); 72 fprintf(stderr, "PowerPC performance report\n Values are from the PMC registers, and represent whatever the registers are set to record.\n");
71 #endif /* POWERPC_PERF_USE_PMC */ 73 #endif /* POWERPC_PERF_USE_PMC */
72 for(i = 0 ; i < powerpc_perf_total ; i++) 74 for(i = 0 ; i < powerpc_perf_total ; i++)
73 { 75 {
74 if (perfdata[i][powerpc_data_num] != (unsigned long long)0) 76 if (perfdata[i][powerpc_data_num] != (unsigned long long)0)
75 fprintf(stderr, " Function \"%s\" (pmc1):\n\tmin: %llu\n\tmax: %llu\n\tavg: %1.2lf (%llu)\n", 77 fprintf(stderr, " Function \"%s\" (pmc1):\n\tmin: %llu\n\tmax: %llu\n\tavg: %1.2lf (%llu)\n",
197 c->sse[1]= sse8_altivec; 199 c->sse[1]= sse8_altivec;
198 c->sse[0]= sse16_altivec; 200 c->sse[0]= sse16_altivec;
199 c->pix_sum = pix_sum_altivec; 201 c->pix_sum = pix_sum_altivec;
200 c->diff_pixels = diff_pixels_altivec; 202 c->diff_pixels = diff_pixels_altivec;
201 c->get_pixels = get_pixels_altivec; 203 c->get_pixels = get_pixels_altivec;
202 // next two disabled as they're untested. 204 // next one disabled as it's untested.
203 #if 0 205 #if 0
204 c->add_bytes= add_bytes_altivec; 206 c->add_bytes= add_bytes_altivec;
205 c->put_pixels_clamped = put_pixels_clamped_altivec; 207 #endif /* 0 */
206 #endif
207 c->put_pixels_tab[0][0] = put_pixels16_altivec; 208 c->put_pixels_tab[0][0] = put_pixels16_altivec;
208 c->avg_pixels_tab[0][0] = avg_pixels16_altivec; 209 c->avg_pixels_tab[0][0] = avg_pixels16_altivec;
209 // next one disabled as it's untested. 210 // next one disabled as it's untested.
210 #if 0 211 #if 0
211 c->avg_pixels_tab[1][0] = avg_pixels8_altivec; 212 c->avg_pixels_tab[1][0] = avg_pixels8_altivec;
212 #endif 213 #endif /* 0 */
213 c->put_pixels_tab[1][3] = put_pixels8_xy2_altivec; 214 c->put_pixels_tab[1][3] = put_pixels8_xy2_altivec;
215 c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_altivec;
216 c->put_pixels_tab[0][3] = put_pixels16_xy2_altivec;
217 c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_altivec;
214 218
215 c->gmc1 = gmc1_altivec; 219 c->gmc1 = gmc1_altivec;
216 220
217 #ifdef POWERPC_TBL_PERFORMANCE_REPORT 221 #ifdef POWERPC_TBL_PERFORMANCE_REPORT
218 { 222 {
219 int i; 223 int i;
220 for (i = 0 ; i < powerpc_perf_total ; i++) 224 for (i = 0 ; i < powerpc_perf_total ; i++)
221 { 225 {
226 #ifdef POWERPC_PERF_USE_PMC 230 #ifdef POWERPC_PERF_USE_PMC
227 perfdata_miss[i][powerpc_data_min] = 0xFFFFFFFFFFFFFFFF; 231 perfdata_miss[i][powerpc_data_min] = 0xFFFFFFFFFFFFFFFF;
228 perfdata_miss[i][powerpc_data_max] = 0x0000000000000000; 232 perfdata_miss[i][powerpc_data_max] = 0x0000000000000000;
229 perfdata_miss[i][powerpc_data_sum] = 0x0000000000000000; 233 perfdata_miss[i][powerpc_data_sum] = 0x0000000000000000;
230 perfdata_miss[i][powerpc_data_num] = 0x0000000000000000; 234 perfdata_miss[i][powerpc_data_num] = 0x0000000000000000;
231 #endif 235 #endif /* POWERPC_PERF_USE_PMC */
232 } 236 }
233 } 237 }
234 #endif 238 #endif /* POWERPC_TBL_PERFORMANCE_REPORT */
235 } else 239 } else
236 #endif 240 #endif /* HAVE_ALTIVEC */
237 { 241 {
238 // Non-AltiVec PPC optimisations 242 // Non-AltiVec PPC optimisations
239 243
240 // ... pending ... 244 // ... pending ...
241 } 245 }