[xiph-commits] r11452 - in trunk/theora: lib win32/VS2005/libtheora

illiminable at svn.xiph.org illiminable at svn.xiph.org
Sun May 28 11:26:31 PDT 2006


Author: illiminable
Date: 2006-05-28 11:26:22 -0700 (Sun, 28 May 2006)
New Revision: 11452

Modified:
   trunk/theora/lib/cpu.c
   trunk/theora/lib/dsp.c
   trunk/theora/win32/VS2005/libtheora/libtheora.vcproj
Log:
* Fix variable names which conflict with register names in cpu.c
* Gaurd against mmx_ext on win32 since it isn't implemented


Modified: trunk/theora/lib/cpu.c
===================================================================
--- trunk/theora/lib/cpu.c	2006-05-28 18:18:26 UTC (rev 11451)
+++ trunk/theora/lib/cpu.c	2006-05-28 18:26:22 UTC (rev 11452)
@@ -18,9 +18,10 @@
 #include "cpu.h"
 
 void
-cpuid(ogg_int32_t op, ogg_uint32_t *eax, ogg_uint32_t *ebx, ogg_uint32_t *ecx, ogg_uint32_t *edx)
+cpuid(ogg_int32_t op, ogg_uint32_t *out_eax, ogg_uint32_t *out_ebx, ogg_uint32_t *out_ecx, ogg_uint32_t *out_edx)
 {
-#if defined(__x86_64__)
+#ifdef USE_ASM
+# if defined(__x86_64__)
   asm volatile ("pushq %%rbx   \n\t"
                 "cpuid         \n\t"
                 "movl %%ebx,%1 \n\t"
@@ -31,7 +32,7 @@
                 "=d" (*edx)          
               : "a" (op)            
               : "cc");
-#elif defined(__i386__)
+# elif defined(__i386__)
   asm volatile ("pushl %%ebx   \n\t"
                 "cpuid         \n\t"
                 "movl %%ebx,%1 \n\t"
@@ -42,6 +43,27 @@
                 "=d" (*edx)          
               : "a" (op)            
               : "cc");
+# elif defined(WIN32)
+    ogg_uint32_t my_eax, my_ebx, my_ecx, my_edx;
+    __asm {
+        //push   ebx
+        mov     eax, op
+        cpuid
+        mov     my_eax, eax
+        mov     my_ebx, ebx
+        mov     my_ecx, ecx
+        mov     my_edx, edx
+        
+
+
+    };
+
+    *out_eax = my_eax;
+    *out_ebx = my_ebx;
+    *out_ecx = my_ecx;
+    *out_edx = my_edx; 
+# endif
+
 #endif
 }
 

Modified: trunk/theora/lib/dsp.c
===================================================================
--- trunk/theora/lib/dsp.c	2006-05-28 18:18:26 UTC (rev 11451)
+++ trunk/theora/lib/dsp.c	2006-05-28 18:26:22 UTC (rev 11452)
@@ -413,9 +413,12 @@
   if (cpuflags & CPU_X86_MMX) {
     dsp_mmx_init(funcs);
   }
+# ifndef WIN32
+  /* This is implemented for win32 yet */
   if (cpuflags & CPU_X86_MMXEXT) {
     dsp_mmxext_init(funcs);
   }
+# endif
 #endif
 }
 

Modified: trunk/theora/win32/VS2005/libtheora/libtheora.vcproj
===================================================================
--- trunk/theora/win32/VS2005/libtheora/libtheora.vcproj	2006-05-28 18:18:26 UTC (rev 11451)
+++ trunk/theora/win32/VS2005/libtheora/libtheora.vcproj	2006-05-28 18:26:22 UTC (rev 11452)
@@ -42,7 +42,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
 				AdditionalIncludeDirectories="..\..\..\include;..\..\..\..\libogg\include;..\..\..\lib"
-				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBTHEORA_EXPORTS; THEORA_USE_ASM"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBTHEORA_EXPORTS; USE_ASM"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="1"
@@ -127,7 +127,7 @@
 				EnableIntrinsicFunctions="true"
 				FavorSizeOrSpeed="1"
 				AdditionalIncludeDirectories="..\..\..\include;..\..\..\..\libogg\include;..\..\..\lib"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBTHEORA_EXPORTS; THEORA_USE_ASM"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBTHEORA_EXPORTS; USE_ASM"
 				StringPooling="true"
 				ExceptionHandling="0"
 				RuntimeLibrary="0"



More information about the commits mailing list