[MPlayer-cvslog] r26051 - in trunk: configure libmpeg2/cpu_accel.c libmpeg2/idct.c libmpeg2/idct_alpha.c libmpeg2/libmpeg-0.4.1.diff

diego subversion at mplayerhq.hu
Thu Feb 21 17:47:05 CET 2008


Author: diego
Date: Thu Feb 21 17:47:05 2008
New Revision: 26051

Log:
Replace Alpha MVI compiler workarounds by a proper configure check.


Modified:
   trunk/configure
   trunk/libmpeg2/cpu_accel.c
   trunk/libmpeg2/idct.c
   trunk/libmpeg2/idct_alpha.c
   trunk/libmpeg2/libmpeg-0.4.1.diff

Modified: trunk/configure
==============================================================================
--- trunk/configure	(original)
+++ trunk/configure	Thu Feb 21 17:47:05 2008
@@ -317,7 +317,7 @@ Codecs:
   --enable-libdca           enable libdca support [autodetect]
   --disable-mp3lib          disable builtin mp3lib [enabled]
   --disable-liba52          disable builtin liba52 [enabled]
-  --disable-libmpeg2        disable builtin libmpeg2 [enabled]
+  --disable-libmpeg2        disable builtin libmpeg2 [autodetect]
   --disable-musepack        disable musepack support [autodetect]
   --disable-libamr_nb       disable libamr narrowband [autodetect]
   --disable-libamr_wb       disable libamr wideband [autodetect]
@@ -568,7 +568,7 @@ _theora=auto
 _mp3lib=yes
 _liba52=yes
 _libdca=auto
-_libmpeg2=yes
+_libmpeg2=auto
 _faad_internal=auto
 _faad_external=auto
 _faad_fixed=no
@@ -2179,15 +2179,6 @@ EOF
     echores "$proc"
     
     _optimizing="$proc"
-
-    echocheck "MVI instruction support in GCC"
-    if test "$_cc_major" -ge "3" && test "$_mvi" = "1" ; 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, GCC = `$_cc -dumpversion 2>&1` (must be >= 3), CPU = $proc (must be pca56 or later)"
-    fi
     ;;
 
   mips)
@@ -6039,6 +6030,17 @@ fi
 echores "$_libdca"
 
 echocheck "internal libmpeg2 support"
+if test "$_libmpeg2" = auto ; then
+  _libmpeg2=yes
+  if alpha && test cc_vendor=gnu; then
+    case $cc_version in
+      2*|3.0*|3.1*) # cannot compile MVI instructions
+        _libmpeg2=no
+        _res_comment="broken gcc"
+        ;;
+    esac
+  fi
+fi
 if test "$_libmpeg2" = yes ; then
   _def_libmpeg2='#define USE_LIBMPEG2 1'
   _codecmodules="libmpeg2 $_codecmodules"
@@ -8329,9 +8331,6 @@ $_def_fast_unaligned
    have the instruction. */
 $_def_dcbzl
 
-/* only gcc3 can compile mvi instructions (libmpeg2) */
-$_def_gcc_mvi_support
-
 /* Define this for Cygwin build for win32 */
 $_def_confwin32
 

Modified: trunk/libmpeg2/cpu_accel.c
==============================================================================
--- trunk/libmpeg2/cpu_accel.c	(original)
+++ trunk/libmpeg2/cpu_accel.c	Thu Feb 21 17:47:05 2008
@@ -224,7 +224,6 @@ static uint32_t arch_accel (void)
 #ifdef ARCH_ALPHA
 static uint32_t arch_accel (void)
 {
-#ifdef CAN_COMPILE_ALPHA_MVI
     uint64_t no_mvi;
 
     asm volatile ("amask %1, %0"
@@ -232,9 +231,6 @@ static 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 /* ACCEL_DETECT */

Modified: trunk/libmpeg2/idct.c
==============================================================================
--- trunk/libmpeg2/idct.c	(original)
+++ trunk/libmpeg2/idct.c	Thu Feb 21 17:47:05 2008
@@ -261,14 +261,11 @@ void mpeg2_idct_init (uint32_t accel)
     } else
 #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 ();
-    } else
-#endif
-    if (accel & MPEG2_ACCEL_ALPHA) {
+    } else if (accel & MPEG2_ACCEL_ALPHA) {
 	int i;
 
 	mpeg2_idct_copy = mpeg2_idct_copy_alpha;

Modified: trunk/libmpeg2/idct_alpha.c
==============================================================================
--- trunk/libmpeg2/idct_alpha.c	(original)
+++ trunk/libmpeg2/idct_alpha.c	Thu Feb 21 17:47:05 2008
@@ -161,7 +161,6 @@ static inline void idct_col (int16_t * c
     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;
@@ -294,7 +293,6 @@ void mpeg2_idct_add_mvi (const int last,
 	stq (p7, dest + 7 * stride);
     }
 }
-#endif
 
 void mpeg2_idct_copy_alpha (int16_t * block, uint8_t * dest, const int stride)
 {

Modified: trunk/libmpeg2/libmpeg-0.4.1.diff
==============================================================================
--- trunk/libmpeg2/libmpeg-0.4.1.diff	(original)
+++ trunk/libmpeg2/libmpeg-0.4.1.diff	Thu Feb 21 17:47:05 2008
@@ -79,24 +79,6 @@
  #endif
      asm volatile ("mtspr 256, %0\n\t"
  		  VAND (0, 0, 0)
-@@ -195,6 +222,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"
-@@ -202,6 +230,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 /* ACCEL_DETECT */
 @@ -212,7 +243,7 @@
  
      accel = 0;
@@ -233,40 +215,6 @@
  	mpeg2_idct_copy = mpeg2_idct_copy_mmx;
  	mpeg2_idct_add = mpeg2_idct_add_mmx;
  	mpeg2_idct_mmx_init ();
-@@ -254,11 +261,14 @@
-     } else
- #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 ();
--    } else if (accel & MPEG2_ACCEL_ALPHA) {
-+    } else
-+#endif
-+    if (accel & MPEG2_ACCEL_ALPHA) {
- 	int i;
- 
- 	mpeg2_idct_copy = mpeg2_idct_copy_alpha;
---- libmpeg2/idct_alpha.c	2006-06-16 20:12:26.000000000 +0200
-+++ libmpeg2/idct_alpha.c	2006-06-16 20:12:50.000000000 +0200
-@@ -157,6 +161,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;
-@@ -289,6 +294,7 @@
- 	stq (p7, dest + 7 * stride);
-     }
- }
-+#endif
- 
- void mpeg2_idct_copy_alpha (int16_t * block, uint8_t * dest, const int stride)
- {
 --- libmpeg2/idct_mmx.c	2006-06-16 20:12:26.000000000 +0200
 +++ libmpeg2/idct_mmx.c	2006-06-16 20:12:50.000000000 +0200
 @@ -23,7 +27,7 @@



More information about the MPlayer-cvslog mailing list