[xiph-commits] r11686 - trunk/theora-exp/lib/x86

j at svn.xiph.org j at svn.xiph.org
Sun Jul 2 09:39:20 PDT 2006


Author: j
Date: 2006-07-02 09:39:16 -0700 (Sun, 02 Jul 2006)
New Revision: 11686

Modified:
   trunk/theora-exp/lib/x86/cpu.c
   trunk/theora-exp/lib/x86/mmxfrag.c
   trunk/theora-exp/lib/x86/mmxidct.c
   trunk/theora-exp/lib/x86/mmxstate.c
   trunk/theora-exp/lib/x86/x86state.c
Log:
hide all code in lib/x86 inside #if defined(OC_X86ASM) / #endif
so it can be included even if x86 asm is not enabled.
this way one can compile universal binaries on OS X with optimized i386 code.



Modified: trunk/theora-exp/lib/x86/cpu.c
===================================================================
--- trunk/theora-exp/lib/x86/cpu.c	2006-07-02 16:14:18 UTC (rev 11685)
+++ trunk/theora-exp/lib/x86/cpu.c	2006-07-02 16:39:16 UTC (rev 11686)
@@ -15,6 +15,8 @@
 #include "cpu.h"
 #include "x86int.h"
 
+#if defined(OC_X86ASM)
+
 ogg_uint32_t oc_cpu_flags_get(void){
   ogg_uint32_t eax;
   ogg_uint32_t ebx;
@@ -94,3 +96,5 @@
   }
   return flags;
 }
+
+#endif

Modified: trunk/theora-exp/lib/x86/mmxfrag.c
===================================================================
--- trunk/theora-exp/lib/x86/mmxfrag.c	2006-07-02 16:14:18 UTC (rev 11685)
+++ trunk/theora-exp/lib/x86/mmxfrag.c	2006-07-02 16:39:16 UTC (rev 11686)
@@ -14,6 +14,8 @@
   Originally written by Rudolf Marek.*/
 #include "x86int.h"
 
+#if defined(OC_X86ASM)
+
 static const __attribute__((aligned(8),used)) ogg_int64_t V128=
  0x0080008000800080LL;
 
@@ -168,3 +170,4 @@
    "  emms    \n\t" /* pack with next(high) four values */
   );
 }
+#endif

Modified: trunk/theora-exp/lib/x86/mmxidct.c
===================================================================
--- trunk/theora-exp/lib/x86/mmxidct.c	2006-07-02 16:14:18 UTC (rev 11685)
+++ trunk/theora-exp/lib/x86/mmxidct.c	2006-07-02 16:39:16 UTC (rev 11686)
@@ -4,7 +4,9 @@
 #include "../dct.h"
 #include "../idct.h"
 
+#include "x86int.h"
 
+#if defined(OC_X86ASM)
 
 /*These are offsets into the table of constants below.*/
 /*4 masks, in order: low word to high.*/
@@ -451,3 +453,4 @@
    " emms\n\t"
   );
 }
+#endif

Modified: trunk/theora-exp/lib/x86/mmxstate.c
===================================================================
--- trunk/theora-exp/lib/x86/mmxstate.c	2006-07-02 16:14:18 UTC (rev 11685)
+++ trunk/theora-exp/lib/x86/mmxstate.c	2006-07-02 16:39:16 UTC (rev 11686)
@@ -15,6 +15,7 @@
 #include "x86int.h"
 #include "../internal.h"
 
+#if defined(OC_X86ASM)
 
 
 static const __attribute__((aligned(8),used)) int OC_FZIG_ZAGMMX[64]={
@@ -260,3 +261,4 @@
   /*This needs to be removed when decode specific functions are implemented:*/
   __asm__ __volatile__("emms\n\t");
 }
+#endif

Modified: trunk/theora-exp/lib/x86/x86state.c
===================================================================
--- trunk/theora-exp/lib/x86/x86state.c	2006-07-02 16:14:18 UTC (rev 11685)
+++ trunk/theora-exp/lib/x86/x86state.c	2006-07-02 16:39:16 UTC (rev 11686)
@@ -1,4 +1,7 @@
 #include "x86int.h"
+
+#if defined(OC_X86ASM)
+
 #include "cpu.h"
 
 void oc_state_vtable_init_x86(oc_theora_state *_state){
@@ -13,3 +16,4 @@
   }
   else oc_state_vtable_init_c(_state);
 }
+#endif



More information about the commits mailing list