# HG changeset patch # User diego # Date 1217075164 0 # Node ID bb5ed9aa34fcd0e64ef9574bb69d87b934213307 # Parent 5707f04b8e692e9dd1fe0e3475f2824ea424f192 Remove AltiVec vector declaration compiler compatibility macros. The original problem was that FSF and Apple gcc used a different syntax for vector declarations, i.e. {} vs. (). Nowadays Apple gcc versions support the standard {} syntax and versions that support {} are available on all relevant Mac OS X versions. Thus the greater compatibility is no longer worth cluttering the code with macros. diff -r 5707f04b8e69 -r bb5ed9aa34fc configure --- a/configure Fri Jul 25 09:15:08 2008 +0000 +++ b/configure Sat Jul 26 12:26:04 2008 +0000 @@ -2470,11 +2470,9 @@ # check if the compiler supports braces for vector declarations cat > $TMPC << EOF $inc_altivec_h -#define AVV(x...) {x} -int main(void) { (vector int) AVV(1); return 0; } -EOF - cc_check $_altivec_gcc_flags && - _def_altivec_vector_braces='#define HAVE_ALTIVEC_VECTOR_BRACES 1' +int main(void) { (vector int) {1}; return 0; } +EOF + cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations." # Disable runtime cpudetection if we cannot generate AltiVec code or # AltiVec is disabled by the user. @@ -8630,7 +8628,6 @@ `ff_config_enable "$_cpuexts_all" "$_cpuexts" "HAVE"` $_def_altivec_h // enables usage of altivec.h -$_def_altivec_vector_braces /* libvo options */ #define SCREEN_SIZE_X 1 diff -r 5707f04b8e69 -r bb5ed9aa34fc liba52/imdct.c --- a/liba52/imdct.c Fri Jul 25 09:15:08 2008 +0000 +++ b/liba52/imdct.c Sat Jul 26 12:26:04 2008 +0000 @@ -382,16 +382,10 @@ #define WORD_s2 0x18,0x19,0x1a,0x1b #define WORD_s3 0x1c,0x1d,0x1e,0x1f -#ifdef HAVE_ALTIVEC_VECTOR_BRACES -#define AVV(x...) {x} -#else -#define AVV(x...) (x) -#endif +#define vcprm(a,b,c,d) (const vector unsigned char){WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d} +#define vcii(a,b,c,d) (const vector float){FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d} -#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) +#define FOUROF(a) {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 diff -r 5707f04b8e69 -r bb5ed9aa34fc liba52/liba52_changes.diff --- a/liba52/liba52_changes.diff Fri Jul 25 09:15:08 2008 +0000 +++ b/liba52/liba52_changes.diff Sat Jul 26 12:26:04 2008 +0000 @@ -1542,7 +1542,7 @@ { int i, k; sample_t t_r, t_i, a_r, a_i, b_r, b_i, w_1, w_2; -@@ -285,6 +365,707 @@ +@@ -285,6 +365,701 @@ } } @@ -1563,16 +1563,10 @@ +#define WORD_s2 0x18,0x19,0x1a,0x1b +#define WORD_s3 0x1c,0x1d,0x1e,0x1f + -+#ifdef HAVE_ALTIVEC_VECTOR_BRACES -+#define AVV(x...) {x} -+#else -+#define AVV(x...) (x) -+#endif ++#define vcprm(a,b,c,d) (const vector unsigned char){WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d} ++#define vcii(a,b,c,d) (const vector float){FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d} + -+#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) ++#define FOUROF(a) {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 diff -r 5707f04b8e69 -r bb5ed9aa34fc mp3lib/dct64_altivec.c --- a/mp3lib/dct64_altivec.c Fri Jul 25 09:15:08 2008 +0000 +++ b/mp3lib/dct64_altivec.c Sat Jul 26 12:26:04 2008 +0000 @@ -27,16 +27,10 @@ #define WORD_s2 0x18,0x19,0x1a,0x1b #define WORD_s3 0x1c,0x1d,0x1e,0x1f -#ifdef HAVE_ALTIVEC_VECTOR_BRACES -#define AVV(x...) {x} -#else -#define AVV(x...) (x) -#endif +#define vcprm(a,b,c,d) (const vector unsigned char){WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d} +#define vcii(a,b,c,d) (const vector float){FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d} -#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) +#define FOUROF(a) {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