summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-03-27 18:48:47 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-03-27 18:48:47 +0000
commit7fcdc66fd1ee1400ce4441b7c8bedd7e8746a31c (patch)
treefe1b8ef3c0bf01335cd25a0768428965a3d8a75e
parent0e70761fd99b1ea958483afb7ad7625c09d26993 (diff)
downloadmpv-7fcdc66fd1ee1400ce4441b7c8bedd7e8746a31c.tar.bz2
mpv-7fcdc66fd1ee1400ce4441b7c8bedd7e8746a31c.tar.xz
Sync cpuid detection code with libavcodec: assume it is always available on x86_64
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29069 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--cpudetect.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/cpudetect.c b/cpudetect.c
index 84ae527089..62afe5895e 100644
--- a/cpudetect.c
+++ b/cpudetect.c
@@ -44,20 +44,15 @@ static void check_os_katmai_support( void );
// 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 signal, struct sigcontext sc )
}
#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){