comparison mp3lib/dct64_altivec.c @ 29263:0f1b5b68af32

whitespace cosmetics: Remove all trailing whitespace.
author diego
date Wed, 13 May 2009 02:58:57 +0000
parents bb5ed9aa34fc
children 347d152a5cfa
comparison
equal deleted inserted replaced
29262:7d545a6b8aff 29263:0f1b5b68af32
44 44
45 void dct64_altivec(real *a,real *b,real *c) 45 void dct64_altivec(real *a,real *b,real *c)
46 { 46 {
47 real __attribute__ ((aligned(16))) b1[0x20]; 47 real __attribute__ ((aligned(16))) b1[0x20];
48 real __attribute__ ((aligned(16))) b2[0x20]; 48 real __attribute__ ((aligned(16))) b2[0x20];
49 49
50 real *out0 = a; 50 real *out0 = a;
51 real *out1 = b; 51 real *out1 = b;
52 real *samples = c; 52 real *samples = c;
53 53
54 const vector float vczero = (const vector float)FOUROF(0.); 54 const vector float vczero = (const vector float)FOUROF(0.);
55 const vector unsigned char reverse = (const vector unsigned char)vcprm(3,2,1,0); 55 const vector unsigned char reverse = (const vector unsigned char)vcprm(3,2,1,0);
56 56
57 57
58 if (((unsigned long)b1 & 0x0000000F) || 58 if (((unsigned long)b1 & 0x0000000F) ||
59 ((unsigned long)b2 & 0x0000000F)) 59 ((unsigned long)b2 & 0x0000000F))
60 60
61 { 61 {
62 printf("MISALIGNED:\t%p\t%p\t%p\t%p\t%p\n", 62 printf("MISALIGNED:\t%p\t%p\t%p\t%p\t%p\n",
63 b1, b2, a, b, samples); 63 b1, b2, a, b, samples);
64 } 64 }
65 65
66 66
67 #ifdef ALTIVEC_USE_REFERENCE_C_CODE 67 #ifdef ALTIVEC_USE_REFERENCE_C_CODE
68 68
69 { 69 {
70 register real *costab = mp3lib_pnts[0]; 70 register real *costab = mp3lib_pnts[0];
71 71
72 b1[0x00] = samples[0x00] + samples[0x1F]; 72 b1[0x00] = samples[0x00] + samples[0x1F];
73 b1[0x01] = samples[0x01] + samples[0x1E]; 73 b1[0x01] = samples[0x01] + samples[0x1E];
247 costabv2 = vec_perm(costabv2, costabv3, costab_perm); 247 costabv2 = vec_perm(costabv2, costabv3, costab_perm);
248 costabv4 = vec_ld(48, costab); 248 costabv4 = vec_ld(48, costab);
249 costabv3 = vec_perm(costabv3, costabv4, costab_perm); 249 costabv3 = vec_perm(costabv3, costabv4, costab_perm);
250 costabv5 = vec_ld(64, costab); 250 costabv5 = vec_ld(64, costab);
251 costabv4 = vec_perm(costabv4, costabv5, costab_perm); 251 costabv4 = vec_perm(costabv4, costabv5, costab_perm);
252 252
253 temp1 = vec_sub(vec_perm(samplesv4, samplesv4, reverse), 253 temp1 = vec_sub(vec_perm(samplesv4, samplesv4, reverse),
254 samplesv5); 254 samplesv5);
255 temp2 = vec_madd(temp1, 255 temp2 = vec_madd(temp1,
256 vec_perm(costabv4, costabv4, reverse), 256 vec_perm(costabv4, costabv4, reverse),
257 vczero); 257 vczero);
258 //vec_st(temp2, 64, b1); 258 //vec_st(temp2, 64, b1);
259 b1v4 = temp2; 259 b1v4 = temp2;
260 260
261 temp1 = vec_sub(vec_perm(samplesv3, samplesv3, reverse), 261 temp1 = vec_sub(vec_perm(samplesv3, samplesv3, reverse),
262 samplesv6); 262 samplesv6);
263 temp2 = vec_madd(temp1, 263 temp2 = vec_madd(temp1,
264 vec_perm(costabv3, costabv3, reverse), 264 vec_perm(costabv3, costabv3, reverse),
265 vczero); 265 vczero);
270 temp2 = vec_madd(temp1, 270 temp2 = vec_madd(temp1,
271 vec_perm(costabv2, costabv2, reverse), 271 vec_perm(costabv2, costabv2, reverse),
272 vczero); 272 vczero);
273 //vec_st(temp2, 96, b1); 273 //vec_st(temp2, 96, b1);
274 b1v6 = temp2; 274 b1v6 = temp2;
275 275
276 temp1 = vec_sub(vec_perm(samplesv1, samplesv1, reverse), 276 temp1 = vec_sub(vec_perm(samplesv1, samplesv1, reverse),
277 samplesv8); 277 samplesv8);
278 temp2 = vec_madd(temp1, 278 temp2 = vec_madd(temp1,
279 vec_perm(costabv1, costabv1, reverse), 279 vec_perm(costabv1, costabv1, reverse),
280 vczero); 280 vczero);
297 costabv1 = vec_perm(costabv1, costabv2, costab_perm); 297 costabv1 = vec_perm(costabv1, costabv2, costab_perm);
298 costabv3 = vec_ld(32, costab); 298 costabv3 = vec_ld(32, costab);
299 costabv2 = vec_perm(costabv2, costabv3 , costab_perm); 299 costabv2 = vec_perm(costabv2, costabv3 , costab_perm);
300 costabv1r = vec_perm(costabv1, costabv1, reverse); 300 costabv1r = vec_perm(costabv1, costabv1, reverse);
301 costabv2r = vec_perm(costabv2, costabv2, reverse); 301 costabv2r = vec_perm(costabv2, costabv2, reverse);
302 302
303 temp1 = vec_add(b1v0, vec_perm(b1v3, b1v3, reverse)); 303 temp1 = vec_add(b1v0, vec_perm(b1v3, b1v3, reverse));
304 //vec_st(temp1, 0, b2); 304 //vec_st(temp1, 0, b2);
305 b2v0 = temp1; 305 b2v0 = temp1;
306 temp1 = vec_add(b1v1, vec_perm(b1v2, b1v2, reverse)); 306 temp1 = vec_add(b1v1, vec_perm(b1v2, b1v2, reverse));
307 //vec_st(temp1, 16, b2); 307 //vec_st(temp1, 16, b2);
331 } 331 }
332 332
333 { 333 {
334 register real *costab = mp3lib_pnts[2]; 334 register real *costab = mp3lib_pnts[2];
335 335
336 336
337 vector float costabv1r, costabv1, costabv2; 337 vector float costabv1r, costabv1, costabv2;
338 vector unsigned char costab_perm = vec_lvsl(0, costab); 338 vector unsigned char costab_perm = vec_lvsl(0, costab);
339 339
340 costabv1 = vec_ld(0, costab); 340 costabv1 = vec_ld(0, costab);
341 costabv2 = vec_ld(16, costab); 341 costabv2 = vec_ld(16, costab);
342 costabv1 = vec_perm(costabv1, costabv2, costab_perm); 342 costabv1 = vec_perm(costabv1, costabv2, costab_perm);
343 costabv1r = vec_perm(costabv1, costabv1, reverse); 343 costabv1r = vec_perm(costabv1, costabv1, reverse);
344 344
345 temp1 = vec_add(b2v0, vec_perm(b2v1, b2v1, reverse)); 345 temp1 = vec_add(b2v0, vec_perm(b2v1, b2v1, reverse));
346 vec_st(temp1, 0, b1); 346 vec_st(temp1, 0, b1);
347 temp2 = vec_sub(vec_perm(b2v0, b2v0, reverse), b2v1); 347 temp2 = vec_sub(vec_perm(b2v0, b2v0, reverse), b2v1);
348 temp1 = vec_madd(temp2, costabv1r, vczero); 348 temp1 = vec_madd(temp2, costabv1r, vczero);
349 vec_st(temp1, 16, b1); 349 vec_st(temp1, 16, b1);
350 350
351 temp1 = vec_add(b2v2, vec_perm(b2v3, b2v3, reverse)); 351 temp1 = vec_add(b2v2, vec_perm(b2v3, b2v3, reverse));
352 vec_st(temp1, 32, b1); 352 vec_st(temp1, 32, b1);
353 temp2 = vec_sub(b2v3, vec_perm(b2v2, b2v2, reverse)); 353 temp2 = vec_sub(b2v3, vec_perm(b2v2, b2v2, reverse));
354 temp1 = vec_madd(temp2, costabv1r, vczero); 354 temp1 = vec_madd(temp2, costabv1r, vczero);
355 vec_st(temp1, 48, b1); 355 vec_st(temp1, 48, b1);
363 temp1 = vec_add(b2v6, vec_perm(b2v7, b2v7, reverse)); 363 temp1 = vec_add(b2v6, vec_perm(b2v7, b2v7, reverse));
364 vec_st(temp1, 96, b1); 364 vec_st(temp1, 96, b1);
365 temp2 = vec_sub(b2v7, vec_perm(b2v6, b2v6, reverse)); 365 temp2 = vec_sub(b2v7, vec_perm(b2v6, b2v6, reverse));
366 temp1 = vec_madd(temp2, costabv1r, vczero); 366 temp1 = vec_madd(temp2, costabv1r, vczero);
367 vec_st(temp1, 112, b1); 367 vec_st(temp1, 112, b1);
368 368
369 } 369 }
370 } 370 }
371 } 371 }
372 372
373 #endif /* ALTIVEC_USE_REFERENCE_C_CODE */ 373 #endif /* ALTIVEC_USE_REFERENCE_C_CODE */