src/cpuinfo/SDL_cpuinfo.c
changeset 3587 2080e8d75ac6
parent 3586 b6758aee0dd4
child 3606 1a4456a01995
     1.1 --- a/src/cpuinfo/SDL_cpuinfo.c	Thu Dec 17 03:04:04 2009 +0000
     1.2 +++ b/src/cpuinfo/SDL_cpuinfo.c	Thu Dec 17 04:01:29 2009 +0000
     1.3 @@ -157,7 +157,7 @@
     1.4      return has_CPUID;
     1.5  }
     1.6  
     1.7 -#if defined(__GNUC__) && (defined(i386) || defined(__x86_64__))
     1.8 +#if defined(__GNUC__) && defined(i386)
     1.9  #define cpuid(func, a, b, c, d) \
    1.10      __asm__ __volatile__ ( \
    1.11  "        pushl %%ebx        \n" \
    1.12 @@ -165,6 +165,14 @@
    1.13  "        movl %%ebx, %%esi  \n" \
    1.14  "        popl %%ebx         \n" : \
    1.15              "=a" (a), "=S" (b), "=c" (c), "=d" (d) : "a" (func))
    1.16 +#elif defined(__GNUC__) && defined(__x86_64__)
    1.17 +#define cpuid(func, a, b, c, d) \
    1.18 +    __asm__ __volatile__ ( \
    1.19 +"        pushq %%rbx        \n" \
    1.20 +"        cpuid              \n" \
    1.21 +"        movq %%rbx, %%rsi  \n" \
    1.22 +"        popq %%rbx         \n" : \
    1.23 +            "=a" (a), "=S" (b), "=c" (c), "=d" (d) : "a" (func))
    1.24  #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
    1.25  #define cpuid(func, a, b, c, d) \
    1.26      __asm { \