From b4547c12fc16e4b2fcb4c547beeeee5d8a427615 Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 27 Jul 2003 22:55:25 +0000 Subject: gcc2.95.x has no support for mvi instructions git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10489 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 12 ++++++++++++ libmpeg2/cpu_accel.c | 4 ++++ libmpeg2/idct.c | 5 ++++- libmpeg2/idct_alpha.c | 2 ++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/configure b/configure index f1841da7aa..61d49629f1 100755 --- a/configure +++ b/configure @@ -919,6 +919,15 @@ EOF fi _mcpu="-mcpu=$proc" echores "$proc" + + echocheck "MVI instruction support in GCC" + if test "$_cc_major" -ge "3"; then + _def_gcc_mvi_support="#define CAN_COMPILE_ALPHA_MVI 1" + echores "yes" + else + _def_gcc_mvi_support="#undef CAN_COMPILE_ALPHA_MVI" + echores "no" + fi ;; mips) @@ -5788,6 +5797,9 @@ $_def_arch #define ARCH_ARM 1 #endif +/* only gcc3 can compile mvi instructions */ +$_def_gcc_mvi_support + /* Define this for Cygwin build for win32 */ $_def_confwin32 diff --git a/libmpeg2/cpu_accel.c b/libmpeg2/cpu_accel.c index b87e8096fc..c2c91e5c0a 100644 --- a/libmpeg2/cpu_accel.c +++ b/libmpeg2/cpu_accel.c @@ -154,6 +154,7 @@ static inline uint32_t arch_accel (void) #ifdef ARCH_ALPHA static inline uint32_t arch_accel (void) { +#ifdef CAN_COMPILE_ALPHA_MVI uint64_t no_mvi; asm volatile ("amask %1, %0" @@ -161,6 +162,9 @@ static inline uint32_t arch_accel (void) : "rI" (256)); /* AMASK_MVI */ return no_mvi ? MPEG2_ACCEL_ALPHA : (MPEG2_ACCEL_ALPHA | MPEG2_ACCEL_ALPHA_MVI); +#else + return MPEG2_ACCEL_ALPHA; +#endif } #endif /* ARCH_ALPHA */ #endif diff --git a/libmpeg2/idct.c b/libmpeg2/idct.c index c91ac535ba..35abf2c5da 100644 --- a/libmpeg2/idct.c +++ b/libmpeg2/idct.c @@ -250,11 +250,14 @@ void mpeg2_idct_init (uint32_t accel) #endif #endif #ifdef ARCH_ALPHA +#ifdef CAN_COMPILE_ALPHA_MVI if (accel & MPEG2_ACCEL_ALPHA_MVI) { mpeg2_idct_copy = mpeg2_idct_copy_mvi; mpeg2_idct_add = mpeg2_idct_add_mvi; mpeg2_idct_alpha_init (0); - } else if (accel & MPEG2_ACCEL_ALPHA) { + } else +#endif + if (accel & MPEG2_ACCEL_ALPHA) { mpeg2_idct_copy = mpeg2_idct_copy_alpha; mpeg2_idct_add = mpeg2_idct_add_alpha; mpeg2_idct_alpha_init (1); diff --git a/libmpeg2/idct_alpha.c b/libmpeg2/idct_alpha.c index a55681f552..bc3ad479ae 100644 --- a/libmpeg2/idct_alpha.c +++ b/libmpeg2/idct_alpha.c @@ -155,6 +155,7 @@ static inline void idct_col (int16_t * const block) block[8*7] = (a0 - b0) >> 17; } +#ifdef CAN_COMPILE_ALPHA_MVI void mpeg2_idct_copy_mvi (int16_t * block, uint8_t * dest, const int stride) { uint64_t clampmask; @@ -287,6 +288,7 @@ void mpeg2_idct_add_mvi (const int last, int16_t * block, stq (p7, dest + 7 * stride); } } +#endif void mpeg2_idct_copy_alpha (int16_t * block, uint8_t * dest, const int stride) { -- cgit v1.2.3