x86: add implicit defs for cpuid

This avoids miscompiling MS inline asm in LLVM where we have to infer
clobbers.  Test case forthcoming in Clang.

llvm-svn: 200279
This commit is contained in:
Reid Kleckner 2014-01-28 02:08:22 +00:00
parent 4aaba3e220
commit b2340d4c8c
1 changed files with 7 additions and 2 deletions

View File

@ -455,8 +455,13 @@ def LMSW16r : I<0x01, MRM6r, (outs), (ins GR16:$src),
"lmsw{w}\t$src", [], IIC_LMSW_MEM>, TB;
def LMSW16m : I<0x01, MRM6m, (outs), (ins i16mem:$src),
"lmsw{w}\t$src", [], IIC_LMSW_REG>, TB;
def CPUID : I<0xA2, RawFrm, (outs), (ins), "cpuid", [], IIC_CPUID>, TB;
let Defs = [EAX, EBX, ECX, EDX], Uses = [EAX, ECX] in
def CPUID32 : I<0xA2, RawFrm, (outs), (ins), "cpuid", [], IIC_CPUID>, TB,
Requires<[Not64BitMode]>;
let Defs = [RAX, RBX, RCX, RDX], Uses = [RAX, RCX] in
def CPUID64 : I<0xA2, RawFrm, (outs), (ins), "cpuid", [], IIC_CPUID>, TB,
Requires<[In64BitMode]>;
} // SchedRW
//===----------------------------------------------------------------------===//