Mercurial > mplayer.hg
diff cpudetect.c @ 13720:821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
author | aurel |
---|---|
date | Thu, 21 Oct 2004 11:55:20 +0000 |
parents | 315f133df221 |
children | d94e79aecd69 |
line wrap: on
line diff
--- a/cpudetect.c Thu Oct 21 11:36:20 2004 +0000 +++ b/cpudetect.c Thu Oct 21 11:55:20 2004 +0000 @@ -9,7 +9,7 @@ #endif #include <stdlib.h> -#ifdef ARCH_X86 +#if defined(ARCH_X86) || defined(ARCH_X86_64) #include <stdio.h> #include <string.h> @@ -47,25 +47,25 @@ // return TRUE if cpuid supported static int has_cpuid() { - int a, c; + long a, c; // code from libavcodec: __asm__ __volatile__ ( /* See if CPUID instruction is supported ... */ /* ... Get copies of EFLAGS into eax and ecx */ "pushf\n\t" - "popl %0\n\t" - "movl %0, %1\n\t" + "pop %0\n\t" + "mov %0, %1\n\t" /* ... Toggle the ID bit in one copy and store */ /* to the EFLAGS reg */ - "xorl $0x200000, %0\n\t" + "xor $0x200000, %0\n\t" "push %0\n\t" "popf\n\t" /* ... Get the (hopefully modified) EFLAGS */ "pushf\n\t" - "popl %0\n\t" + "pop %0\n\t" : "=a" (a), "=c" (c) : : "cc" @@ -87,9 +87,9 @@ #else // code from libavcodec: __asm __volatile - ("movl %%ebx, %%esi\n\t" + ("mov %%"REG_b", %%"REG_S"\n\t" "cpuid\n\t" - "xchgl %%ebx, %%esi" + "xchg %%"REG_b", %%"REG_S : "=a" (p[0]), "=S" (p[1]), "=c" (p[2]), "=d" (p[3]) : "0" (ax)); @@ -456,7 +456,7 @@ gCpuCaps.hasSSE=0; #endif /* __linux__ */ } -#else /* ARCH_X86 */ +#else /* ARCH_X86 || ARCH_X86_64 */ #ifdef SYS_DARWIN #include <sys/sysctl.h> @@ -536,10 +536,6 @@ mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: Intel Itanium\n"); #endif -#ifdef ARCH_X86_64 - mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: Advanced Micro Devices 64-bit CPU\n"); -#endif - #ifdef ARCH_SPARC mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: Sun Sparc\n"); #endif