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

sping at svn.xiph.org sping at svn.xiph.org
Tue Oct 2 14:13:24 PDT 2007


Author: sping
Date: 2007-10-02 14:13:24 -0700 (Tue, 02 Oct 2007)
New Revision: 13923

Removed:
   trunk/theora/lib/cpu_asm_1_gcc.c
   trunk/theora/lib/cpu_asm_1_msvc.c
   trunk/theora/update_asm.sh
Modified:
   trunk/theora/lib/cpu.c
Log:
Revert by request using 'svn merge -r 13922:13919 .'


Modified: trunk/theora/lib/cpu.c
===================================================================
--- trunk/theora/lib/cpu.c	2007-10-02 20:50:28 UTC (rev 13922)
+++ trunk/theora/lib/cpu.c	2007-10-02 21:13:24 UTC (rev 13923)
@@ -23,10 +23,10 @@
 
 ogg_uint32_t oc_cpu_flags_get(void){
   ogg_uint32_t flags = 0;
-  ogg_uint32_t v_eax;
-  ogg_uint32_t v_ebx;
-  ogg_uint32_t v_ecx;
-  ogg_uint32_t v_edx;
+  ogg_uint32_t eax;
+  ogg_uint32_t ebx;
+  ogg_uint32_t ecx;
+  ogg_uint32_t edx;
 #if defined(USE_ASM)
 #if (defined(__amd64__) || defined(__x86_64__))
 # define cpuid(_op,_eax,_ebx,_ecx,_edx) \
@@ -56,38 +56,47 @@
    :"a" (_op) \
    :"cc" \
   )
-
-#ifdef _MSC_VER
-# include "cpu_asm_1_msvc.c"
-#else
-# include "cpu_asm_1_gcc.c"
-#endif
-
+  __asm__ __volatile__(
+   "pushfl\n\t"
+   "pushfl\n\t"
+   "popl          %0\n\t"
+   "movl          %0,%1\n\t"
+   "xorl   $0x200000,%0\n\t"
+   "pushl         %0\n\t"
+   "popfl\n\t"
+   "pushfl\n\t"
+   "popl          %0\n\t"
+   "popfl\n\t"
+   :"=r" (eax),
+    "=r" (ebx)
+   :
+   :"cc"
+  );
   /*No cpuid.*/
   if(eax==ebx)return 0;
 #endif
-  cpuid(0,v_eax,v_ebx,v_ecx,v_edx);
-  if(v_ebx==0x756e6547&&v_edx==0x49656e69&&v_ecx==0x6c65746e){
+  cpuid(0,eax,ebx,ecx,edx);
+  if(ebx==0x756e6547&&edx==0x49656e69&&ecx==0x6c65746e){
     /*Intel:*/
 inteltest:
     cpuid(1,eax,ebx,ecx,edx);
-    if((v_edx&0x00800000)==0)return 0;
+    if((edx&0x00800000)==0)return 0;
     flags=OC_CPU_X86_MMX;
-    if(v_edx&0x02000000)flags|=OC_CPU_X86_MMXEXT|OC_CPU_X86_SSE;
-    if(v_edx&0x04000000)flags|=OC_CPU_X86_SSE2;
+    if(edx&0x02000000)flags|=OC_CPU_X86_MMXEXT|OC_CPU_X86_SSE;
+    if(edx&0x04000000)flags|=OC_CPU_X86_SSE2;
   }
-  else if(v_ebx==0x68747541&&v_edx==0x69746e65&&v_ecx==0x444d4163 ||
-          v_ebx==0x646f6547&&v_edx==0x79622065&&v_ecx==0x43534e20){
+  else if(ebx==0x68747541&&edx==0x69746e65&&ecx==0x444d4163 ||
+          ebx==0x646f6547&&edx==0x79622065&&ecx==0x43534e20){
     /*AMD:*/
     /*Geode:*/
-    cpuid(0x80000000,v_eax,v_ebx,v_ecx,v_edx);
-    if(v_eax<0x80000001)goto inteltest;
-    cpuid(0x80000001,v_eax,v_ebx,v_ecx,v_edx);
-    if((v_edx&0x00800000)==0)return 0;
+    cpuid(0x80000000,eax,ebx,ecx,edx);
+    if(eax<0x80000001)goto inteltest;
+    cpuid(0x80000001,eax,ebx,ecx,edx);
+    if((edx&0x00800000)==0)return 0;
     flags=OC_CPU_X86_MMX;
-    if(v_edx&0x80000000)flags|=OC_CPU_X86_3DNOW;
-    if(v_edx&0x40000000)flags|=OC_CPU_X86_3DNOWEXT;
-    if(v_edx&0x00400000)flags|=OC_CPU_X86_MMXEXT;
+    if(edx&0x80000000)flags|=OC_CPU_X86_3DNOW;
+    if(edx&0x40000000)flags|=OC_CPU_X86_3DNOWEXT;
+    if(edx&0x00400000)flags|=OC_CPU_X86_MMXEXT;
   }
   else{
     /*Implement me.*/

Deleted: trunk/theora/lib/cpu_asm_1_gcc.c
===================================================================
--- trunk/theora/lib/cpu_asm_1_gcc.c	2007-10-02 20:50:28 UTC (rev 13922)
+++ trunk/theora/lib/cpu_asm_1_gcc.c	2007-10-02 21:13:24 UTC (rev 13923)
@@ -1,21 +0,0 @@
-#ifdef USE_ASM
-
-  __asm__ __volatile__(
-   "pushfl\n\t"
-   "pushfl\n\t"
-   "popl          %0\n\t"
-   "movl          %0,%1\n\t"
-   "xorl   $0x200000,%0\n\t"
-   "pushl         %0\n\t"
-   "popfl\n\t"
-   "pushfl\n\t"
-   "popl          %0\n\t"
-   "popfl\n\t"
-   :"=r" (eax),
-    "=r" (ebx)
-   :
-   :"cc"
-  );
-
-#endif /* USE_ASM */
-

Deleted: trunk/theora/lib/cpu_asm_1_msvc.c
===================================================================
--- trunk/theora/lib/cpu_asm_1_msvc.c	2007-10-02 20:50:28 UTC (rev 13922)
+++ trunk/theora/lib/cpu_asm_1_msvc.c	2007-10-02 21:13:24 UTC (rev 13923)
@@ -1,16 +0,0 @@
-#ifdef USE_ASM
-
-__asm {
-   pushfl
-   pushfl
-   popl          eax
-   movl          eax,ebx
-   xorl   0x200000,eax
-   pushl         eax
-   popfl
-   pushfl
-   popl          eax
-   popfl
-}
-
-#endif /* USE_ASM */

Deleted: trunk/theora/update_asm.sh
===================================================================
--- trunk/theora/update_asm.sh	2007-10-02 20:50:28 UTC (rev 13922)
+++ trunk/theora/update_asm.sh	2007-10-02 21:13:24 UTC (rev 13923)
@@ -1,28 +0,0 @@
-#! /bin/bash
-# ---------------------------------------
-# Written by Sebastian Pipping <sping at xiph.org>
-#
-# WORK IN PROGRESS!
-# ---------------------------------------
-
-IN_FILE="lib/cpu_asm_1_gcc.c"
-OUT_FILE="lib/cpu_asm_1_msvc.c"
-
-echo "#ifdef USE_ASM" > ${OUT_FILE}
-echo "" >> ${OUT_FILE}
-echo "__asm {" >> ${OUT_FILE}
-
-cat ${IN_FILE}\
-    | grep '\\n\\t'\
-    | sed -r 's/\\n\\t//'\
-    | sed -r 's/%0/eax/'\
-    | sed -r 's/%1/ebx/'\
-    | sed -r 's/"(.+)"/\1/'\
-    | sed -r 's/\$((0x)?[0-9]+)/\1/'\
-    >> lib/cpu_asm_1_msvc.c
-
-echo "}" >> ${OUT_FILE}
-echo "" >> ${OUT_FILE}
-echo "#endif /* USE_ASM */" >> ${OUT_FILE}
-
-cat ${OUT_FILE}



More information about the commits mailing list