[MPlayer-cvslog] r29069 - trunk/cpudetect.c

reimar subversion at mplayerhq.hu
Fri Mar 27 19:48:48 CET 2009


Author: reimar
Date: Fri Mar 27 19:48:47 2009
New Revision: 29069

Log:
Sync cpuid detection code with libavcodec: assume it is always available on x86_64

Modified:
   trunk/cpudetect.c

Modified: trunk/cpudetect.c
==============================================================================
--- trunk/cpudetect.c	Fri Mar 27 18:14:58 2009	(r29068)
+++ trunk/cpudetect.c	Fri Mar 27 19:48:47 2009	(r29069)
@@ -44,20 +44,15 @@ static void check_os_katmai_support( voi
 // return TRUE if cpuid supported
 static int has_cpuid(void)
 {
-	long a, c;
-
 // code from libavcodec:
 #if ARCH_X86_64
-#define PUSHF "pushfq\n\t"
-#define POPF "popfq\n\t"
+   return 1;
 #else
-#define PUSHF "pushfl\n\t"
-#define POPF "popfl\n\t"
-#endif
+	long a, c;
     __asm__ volatile (
                           /* See if CPUID instruction is supported ... */
                           /* ... Get copies of EFLAGS into eax and ecx */
-                          PUSHF
+                          "pushfl\n\t"
                           "pop %0\n\t"
                           "mov %0, %1\n\t"
                           
@@ -65,19 +60,18 @@ static int has_cpuid(void)
                           /*     to the EFLAGS reg */
                           "xor $0x200000, %0\n\t"
                           "push %0\n\t"
-                          POPF
+                          "popfl\n\t"
                           
                           /* ... Get the (hopefully modified) EFLAGS */
-                          PUSHF
+                          "pushfl\n\t"
                           "pop %0\n\t"
                           : "=a" (a), "=c" (c)
                           :
                           : "cc" 
                           );
-#undef PUSHF
-#undef POPF
 
 	return a != c;
+#endif
 }
 
 static void
@@ -277,7 +271,7 @@ static void sigill_handler_sse( int sign
 }
 #endif /* __linux__ && _POSIX_SOURCE */
 
-#if defined(__MINGW32__) || defined(__CYGWIN__)
+#if (defined(__MINGW32__) || defined(__CYGWIN__)) && !ARCH_X86_64
 LONG CALLBACK win32_sig_handler_sse(EXCEPTION_POINTERS* ep)
 {
    if(ep->ExceptionRecord->ExceptionCode==EXCEPTION_ILLEGAL_INSTRUCTION){


More information about the MPlayer-cvslog mailing list