# HG changeset patch # User diego # Date 1203377594 0 # Node ID dcb28cc9ca2c1d44a2df8628d45af5b9d63247a6 # Parent 236ab58453f7769da99e6ad8301a9925cdf0aa49 Refactor AltiVec macros as done for FFmpeg. diff -r 236ab58453f7 -r dcb28cc9ca2c mp3lib/dct64_altivec.c --- a/mp3lib/dct64_altivec.c Mon Feb 18 23:32:17 2008 +0000 +++ b/mp3lib/dct64_altivec.c Mon Feb 18 23:33:14 2008 +0000 @@ -28,11 +28,16 @@ #define WORD_s3 0x1c,0x1d,0x1e,0x1f #ifdef __APPLE_CC__ -#define vcprm(a,b,c,d) (const vector unsigned char)(WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d) +#define AVV(x...) (x) #else -#define vcprm(a,b,c,d) (const vector unsigned char){WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d} +#define AVV(x...) {x} #endif +#define vcprm(a,b,c,d) (const vector unsigned char)AVV(WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d) +#define vcii(a,b,c,d) (const vector float)AVV(FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d) + +#define FOUROF(a) AVV(a,a,a,a) + // vcprmle is used to keep the same index as in the SSE version. // it's the same as vcprm, with the index inversed // ('le' is Little Endian) @@ -43,18 +48,6 @@ #define FLOAT_n -1. #define FLOAT_p 1. -#ifdef __APPLE_CC__ -#define vcii(a,b,c,d) (const vector float)(FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d) -#else -#define vcii(a,b,c,d) (const vector float){FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d} -#endif - -#ifdef __APPLE_CC__ -#define FOUROF(a) (a) -#else -#define FOUROF(a) {a,a,a,a} -#endif - void dct64_altivec(real *a,real *b,real *c) { real __attribute__ ((aligned(16))) b1[0x20];