0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

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.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27350 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
diego 2008-07-26 12:26:04 +00:00
parent 1d0ab01312
commit d1dcbd2f87
4 changed files with 12 additions and 33 deletions

7
configure vendored
View File

@ -2470,11 +2470,9 @@ EOF
# check if the compiler supports braces for vector declarations # check if the compiler supports braces for vector declarations
cat > $TMPC << EOF cat > $TMPC << EOF
$inc_altivec_h $inc_altivec_h
#define AVV(x...) {x} int main(void) { (vector int) {1}; return 0; }
int main(void) { (vector int) AVV(1); return 0; }
EOF EOF
cc_check $_altivec_gcc_flags && cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
_def_altivec_vector_braces='#define HAVE_ALTIVEC_VECTOR_BRACES 1'
# Disable runtime cpudetection if we cannot generate AltiVec code or # Disable runtime cpudetection if we cannot generate AltiVec code or
# AltiVec is disabled by the user. # AltiVec is disabled by the user.
@ -8630,7 +8628,6 @@ $_def_gethostbyname2
`ff_config_enable "$_cpuexts_all" "$_cpuexts" "HAVE"` `ff_config_enable "$_cpuexts_all" "$_cpuexts" "HAVE"`
$_def_altivec_h // enables usage of altivec.h $_def_altivec_h // enables usage of altivec.h
$_def_altivec_vector_braces
/* libvo options */ /* libvo options */
#define SCREEN_SIZE_X 1 #define SCREEN_SIZE_X 1

View File

@ -382,16 +382,10 @@ void imdct_do_512 (sample_t * data, sample_t * delay, sample_t bias)
#define WORD_s2 0x18,0x19,0x1a,0x1b #define WORD_s2 0x18,0x19,0x1a,0x1b
#define WORD_s3 0x1c,0x1d,0x1e,0x1f #define WORD_s3 0x1c,0x1d,0x1e,0x1f
#ifdef HAVE_ALTIVEC_VECTOR_BRACES #define vcprm(a,b,c,d) (const vector unsigned char){WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d}
#define AVV(x...) {x} #define vcii(a,b,c,d) (const vector float){FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d}
#else
#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 FOUROF(a) {a,a,a,a}
#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. // vcprmle is used to keep the same index as in the SSE version.
// it's the same as vcprm, with the index inversed // it's the same as vcprm, with the index inversed

View File

@ -1542,7 +1542,7 @@
{ {
int i, k; int i, k;
sample_t t_r, t_i, a_r, a_i, b_r, b_i, w_1, w_2; 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_s2 0x18,0x19,0x1a,0x1b
+#define WORD_s3 0x1c,0x1d,0x1e,0x1f +#define WORD_s3 0x1c,0x1d,0x1e,0x1f
+ +
+#ifdef HAVE_ALTIVEC_VECTOR_BRACES +#define vcprm(a,b,c,d) (const vector unsigned char){WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d}
+#define AVV(x...) {x} +#define vcii(a,b,c,d) (const vector float){FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d}
+#else
+#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 FOUROF(a) {a,a,a,a}
+#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. +// vcprmle is used to keep the same index as in the SSE version.
+// it's the same as vcprm, with the index inversed +// it's the same as vcprm, with the index inversed

View File

@ -27,16 +27,10 @@
#define WORD_s2 0x18,0x19,0x1a,0x1b #define WORD_s2 0x18,0x19,0x1a,0x1b
#define WORD_s3 0x1c,0x1d,0x1e,0x1f #define WORD_s3 0x1c,0x1d,0x1e,0x1f
#ifdef HAVE_ALTIVEC_VECTOR_BRACES #define vcprm(a,b,c,d) (const vector unsigned char){WORD_ ## a, WORD_ ## b, WORD_ ## c, WORD_ ## d}
#define AVV(x...) {x} #define vcii(a,b,c,d) (const vector float){FLOAT_ ## a, FLOAT_ ## b, FLOAT_ ## c, FLOAT_ ## d}
#else
#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 FOUROF(a) {a,a,a,a}
#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. // vcprmle is used to keep the same index as in the SSE version.
// it's the same as vcprm, with the index inversed // it's the same as vcprm, with the index inversed