diff options
| author | Reid Kleckner <reid@kleckner.net> | 2014-01-28 02:08:22 +0000 |
|---|---|---|
| committer | Reid Kleckner <reid@kleckner.net> | 2014-01-28 02:08:22 +0000 |
| commit | b2340d4c8c31fde6181a719d41896ba706553ed5 (patch) | |
| tree | 48342ad61acce67091705eac12ef1e95f5df7336 /llvm/lib/Target/X86/X86InstrSystem.td | |
| parent | 4aaba3e2200d91a79735b7d011f4d060d64434c9 (diff) | |
| download | bcm5719-llvm-b2340d4c8c31fde6181a719d41896ba706553ed5.tar.gz bcm5719-llvm-b2340d4c8c31fde6181a719d41896ba706553ed5.zip | |
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
Diffstat (limited to 'llvm/lib/Target/X86/X86InstrSystem.td')
| -rw-r--r-- | llvm/lib/Target/X86/X86InstrSystem.td | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86InstrSystem.td b/llvm/lib/Target/X86/X86InstrSystem.td index e1b008e7fad..abed426bce7 100644 --- a/llvm/lib/Target/X86/X86InstrSystem.td +++ b/llvm/lib/Target/X86/X86InstrSystem.td @@ -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 //===----------------------------------------------------------------------===// |

