diff options
Diffstat (limited to 'third_party/lzma_sdk/CpuArch.c')
-rw-r--r-- | third_party/lzma_sdk/CpuArch.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/third_party/lzma_sdk/CpuArch.c b/third_party/lzma_sdk/CpuArch.c index f8df6b2..272220e 100644 --- a/third_party/lzma_sdk/CpuArch.c +++ b/third_party/lzma_sdk/CpuArch.c @@ -72,6 +72,20 @@ static void MyCPUID(UInt32 function, UInt32 *a, UInt32 *b, UInt32 *c, UInt32 *d) #else + #if defined(MY_CPU_AMD64) + + __asm__ __volatile__ ( + "mov %%rbx, %%rdi\n" + "cpuid\n" + "xchg %%rdi, %%rbx\n" + : "=a" (*a) , + "=D" (*b) , + "=c" (*c) , + "=d" (*d) + : "0" (function)) ; + + #else + __asm__ __volatile__ ( "mov %%ebx, %%edi\n" "cpuid\n" @@ -83,6 +97,8 @@ static void MyCPUID(UInt32 function, UInt32 *a, UInt32 *b, UInt32 *c, UInt32 *d) : "0" (function)) ; #endif + + #endif #else |