aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-01-27 19:30:30 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-01-27 19:30:30 +0000
commitb3a7e21b7e441ed4d51e673b0890aed6b0524566 (patch)
treefa736ee107e6f4e92919381f1392778d8d7553e0
parent3ea0e0e005b6e047756f40c0848b82811d357463 (diff)
A better workaround
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25692 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/X86/X86Subtarget.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/Target/X86/X86Subtarget.cpp b/lib/Target/X86/X86Subtarget.cpp
index 0f6c69c79b..faa090718b 100644
--- a/lib/Target/X86/X86Subtarget.cpp
+++ b/lib/Target/X86/X86Subtarget.cpp
@@ -22,11 +22,10 @@ static void GetCpuIDAndInfo(unsigned value, unsigned *EAX, unsigned *EBX,
#if defined(__GNUC__)
asm ("pushl\t%%ebx\n\t"
"cpuid\n\t"
+ "movl\t%%ebx, %%esi\n\t"
"popl\t%%ebx"
: "=a" (*EAX),
-#if !defined(__DYNAMIC__) // This works around a gcc -fPIC bug
- "=b" (*EBX),
-#endif
+ "=S" (*EBX),
"=c" (*ECX),
"=d" (*EDX)
: "a" (value));
@@ -35,11 +34,11 @@ static void GetCpuIDAndInfo(unsigned value, unsigned *EAX, unsigned *EBX,
}
static const char *GetCurrentX86CPU() {
- unsigned EAX = 0, DUMMY = 0, ECX = 0, EDX = 0;
- GetCpuIDAndInfo(0x1, &EAX, &DUMMY, &ECX, &EDX);
+ unsigned EAX = 0, EBX = 0, ECX = 0, EDX = 0;
+ GetCpuIDAndInfo(0x1, &EAX, &EBX, &ECX, &EDX);
unsigned Family = (EAX & (0xffffffff >> (32 - 4)) << 8) >> 8; // Bits 8 - 11
unsigned Model = (EAX & (0xffffffff >> (32 - 4)) << 4) >> 4; // Bits 4 - 7
- GetCpuIDAndInfo(0x80000001, &EAX, &DUMMY, &ECX, &EDX);
+ GetCpuIDAndInfo(0x80000001, &EAX, &EBX, &ECX, &EDX);
bool Em64T = EDX & (1 << 29);
switch (Family) {