[xiph-commits] r11444 - in trunk/theora: . lib

giles at svn.xiph.org giles at svn.xiph.org
Sat May 27 16:35:58 PDT 2006


Author: giles
Date: 2006-05-27 16:35:57 -0700 (Sat, 27 May 2006)
New Revision: 11444

Modified:
   trunk/theora/configure.ac
   trunk/theora/lib/cpu.c
   trunk/theora/lib/dct.c
   trunk/theora/lib/dsp.c
   trunk/theora/lib/dsp.h
Log:
Conditionalize the asm with an additional USE_ASM so it can be disabled.


Modified: trunk/theora/configure.ac
===================================================================
--- trunk/theora/configure.ac	2006-05-27 23:34:33 UTC (rev 11443)
+++ trunk/theora/configure.ac	2006-05-27 23:35:57 UTC (rev 11444)
@@ -97,15 +97,20 @@
         *)
                 DEBUG="-g -Wall -DDEBUG -D__NO_MATH_INLINES"
                 CFLAGS="-Wall -O3 -fforce-addr -fomit-frame-pointer -finline-functions -funroll-loops"
-                PROFILE="-Wall -pg -g -O3 -fno-inline-functions -DDEBGU";;
+                PROFILE="-Wall -pg -g -O3 -fno-inline-functions -DDEBUG";;
         esac
 fi
 CFLAGS="$CFLAGS $cflags_save"
 
-cpu_optimization="no optimization for your platform, please send a patch"
 cpu_x86_64=no
 cpu_x86_32=no
-case $target_cpu in
+AC_ARG_ENABLE(asm,
+    [  --disable-asm           disable assembly optimizations ],
+    [ ac_enable_asm=$enableval ], [ ac_enable_asm=yes] )
+
+if test "x${ac_enable_asm}" = xyes; then
+  cpu_optimization="no optimization for your platform, please send a patch"
+  case $target_cpu in
 	i[[3456]]86)
 		cpu_x86_32=yes 
 		cpu_optimization="32 bit x86"
@@ -114,7 +119,10 @@
 		cpu_x86_64=yes
 		cpu_optimization="64 bit x86"
 	;;
-esac
+  esac
+else
+  cpu_optimization="disabled"
+fi
 AM_CONDITIONAL([CPU_x86_64], [test x$cpu_x86_64 = xyes])
 AM_CONDITIONAL([CPU_x86_32], [test x$cpu_x86_32 = xyes])
 

Modified: trunk/theora/lib/cpu.c
===================================================================
--- trunk/theora/lib/cpu.c	2006-05-27 23:34:33 UTC (rev 11443)
+++ trunk/theora/lib/cpu.c	2006-05-27 23:35:57 UTC (rev 11444)
@@ -45,7 +45,8 @@
 #endif
 }
 
-#if defined(__x86_64__) || defined(__i386__)
+#if defined(USE_ASM) && (defined(__i386__) || defined(__x86_64__))
+
 static ogg_uint32_t cpu_get_flags (void)
 {
   ogg_uint32_t eax, ebx, ecx, edx;
@@ -101,13 +102,13 @@
   return flags;
 }
 
-#else /* not an i386 or x86_64 */
+#else /* no supported cpu architecture */
 
 static ogg_uint32_t cpu_get_flags (void) {
   return 0;
 }
 
-#endif
+#endif /* USE_ASM */
 
 ogg_uint32_t cpu_init (void)
 {

Modified: trunk/theora/lib/dct.c
===================================================================
--- trunk/theora/lib/dct.c	2006-05-27 23:34:33 UTC (rev 11443)
+++ trunk/theora/lib/dct.c	2006-05-27 23:35:57 UTC (rev 11444)
@@ -257,7 +257,7 @@
 void dsp_dct_init (DspFunctions *funcs, ogg_uint32_t cpu_flags)
 {
   funcs->fdct_short = fdct_short__c;
-#if (defined(__i386__) || defined(__x86_64__))
+#if defined(USE_ASM)
   if (cpu_flags & CPU_X86_MMX) {
     dsp_mmx_fdct_init(funcs);
   }

Modified: trunk/theora/lib/dsp.c
===================================================================
--- trunk/theora/lib/dsp.c	2006-05-27 23:34:33 UTC (rev 11443)
+++ trunk/theora/lib/dsp.c	2006-05-27 23:35:57 UTC (rev 11444)
@@ -409,7 +409,7 @@
 
   dsp_recon_init (funcs, cpuflags);
   dsp_dct_init (funcs, cpuflags);
-#if (defined(__i386__) || defined(__x86_64__))
+#if defined(USE_ASM)
   if (cpuflags & CPU_X86_MMX) {
     dsp_mmx_init(funcs);
   }

Modified: trunk/theora/lib/dsp.h
===================================================================
--- trunk/theora/lib/dsp.h	2006-05-27 23:34:33 UTC (rev 11443)
+++ trunk/theora/lib/dsp.h	2006-05-27 23:35:57 UTC (rev 11444)
@@ -85,7 +85,7 @@
 
 void dsp_init(DspFunctions *funcs);
 void dsp_static_init(DspFunctions *funcs);
-#if defined(__i386__)
+#if defined(USE_ASM) && (defined(__i386__) || defined(__x86_64__))
 extern void dsp_mmx_init(DspFunctions *funcs);
 extern void dsp_mmxext_init(DspFunctions *funcs);
 extern void dsp_mmx_fdct_init(DspFunctions *funcs);



More information about the commits mailing list