Proper fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30993 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2006-10-17 00:24:49 +00:00
parent cf92230e3e
commit f896d1e247

View File

@ -32,16 +32,15 @@ AsmWriterFlavor("x86-asm-syntax", cl::init(X86Subtarget::unset),
bool X86::GetCpuIDAndInfo(unsigned value, unsigned *rEAX, unsigned *rEBX,
unsigned *rECX, unsigned *rEDX) {
#if defined(__x86_64__)
unsigned long long saveRBX;
asm ("nop" : "=b" (saveRBX));
asm ("cpuid\n\t"
"movl\t%%ebx, %%esi\n\t"
// gcc doesn't know cpuid would clobber ebx/rbx. Preseve it manually.
asm ("movq\t%%rbx, %%rsi\n\t"
"cpuid\n\t"
"xchgq\t%%rbx, %%rsi\n\t"
: "=a" (*rEAX),
"=S" (*rEBX),
"=c" (*rECX),
"=d" (*rEDX)
: "a" (value));
asm ("nop" :: "b" (saveRBX));
return false;
#elif defined(i386) || defined(__i386__) || defined(__x86__) || defined(_M_IX86)
#if defined(__GNUC__)