changeset 10488:ec04f41e2480

gcc2.95.x has no support for mvi instructions
author alex
date Sun, 27 Jul 2003 22:55:25 +0000
parents 11ec7586a0fe
children b7a6edb6100e
files configure libmpeg2/cpu_accel.c libmpeg2/idct.c libmpeg2/idct_alpha.c
diffstat 4 files changed, 22 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Sun Jul 27 22:41:53 2003 +0000
+++ b/configure	Sun Jul 27 22:55:25 2003 +0000
@@ -919,6 +919,15 @@
     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 @@
 #define ARCH_ARM 1
 #endif
 
+/* only gcc3 can compile mvi instructions */
+$_def_gcc_mvi_support
+
 /* Define this for Cygwin build for win32 */
 $_def_confwin32
 
--- a/libmpeg2/cpu_accel.c	Sun Jul 27 22:41:53 2003 +0000
+++ b/libmpeg2/cpu_accel.c	Sun Jul 27 22:55:25 2003 +0000
@@ -154,6 +154,7 @@
 #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 @@
 		  : "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
--- a/libmpeg2/idct.c	Sun Jul 27 22:41:53 2003 +0000
+++ b/libmpeg2/idct.c	Sun Jul 27 22:55:25 2003 +0000
@@ -250,11 +250,14 @@
 #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);
--- a/libmpeg2/idct_alpha.c	Sun Jul 27 22:41:53 2003 +0000
+++ b/libmpeg2/idct_alpha.c	Sun Jul 27 22:55:25 2003 +0000
@@ -155,6 +155,7 @@
     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 @@
 	stq (p7, dest + 7 * stride);
     }
 }
+#endif
 
 void mpeg2_idct_copy_alpha (int16_t * block, uint8_t * dest, const int stride)
 {