diff options
| author | Reid Kleckner <reid@kleckner.net> | 2014-09-04 16:58:25 +0000 |
|---|---|---|
| committer | Reid Kleckner <reid@kleckner.net> | 2014-09-04 16:58:25 +0000 |
| commit | aedf0d705f51473cfcdc06bd96091aff0be8701a (patch) | |
| tree | 56cb925d4ec06cfa93b0872ae2e2df0daee9e1bb /llvm | |
| parent | 8ae63c127d6c218ff7f2fddb5f6e8ccaabd5d64a (diff) | |
| download | bcm5719-llvm-aedf0d705f51473cfcdc06bd96091aff0be8701a.tar.gz bcm5719-llvm-aedf0d705f51473cfcdc06bd96091aff0be8701a.zip | |
X86: cpuid and xgetbv write to 32-bit registers, not 64-bit
This fixes an issue where MS inline assembly containing xgetbv wouldn't
be marked as clobbering EAX:EDX. Test for that forthcoming on the Clang
side.
llvm-svn: 217173
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Target/X86/X86InstrSystem.td | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/llvm/lib/Target/X86/X86InstrSystem.td b/llvm/lib/Target/X86/X86InstrSystem.td index 92f8bae0479..8cabdd0424d 100644 --- a/llvm/lib/Target/X86/X86InstrSystem.td +++ b/llvm/lib/Target/X86/X86InstrSystem.td @@ -462,11 +462,7 @@ def LMSW16m : I<0x01, MRM6m, (outs), (ins i16mem:$src), "lmsw{w}\t$src", [], IIC_LMSW_REG>, 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]>; + def CPUID : I<0xA2, RawFrm, (outs), (ins), "cpuid", [], IIC_CPUID>, TB; } // SchedRW //===----------------------------------------------------------------------===// @@ -479,10 +475,10 @@ def WBINVD : I<0x09, RawFrm, (outs), (ins), "wbinvd", [], IIC_INVD>, TB; //===----------------------------------------------------------------------===// // XSAVE instructions let SchedRW = [WriteSystem] in { -let Defs = [RDX, RAX], Uses = [RCX] in +let Defs = [EDX, EAX], Uses = [ECX] in def XGETBV : I<0x01, MRM_D0, (outs), (ins), "xgetbv", []>, TB; -let Uses = [RDX, RAX, RCX] in +let Uses = [EDX, EAX, ECX] in def XSETBV : I<0x01, MRM_D1, (outs), (ins), "xsetbv", []>, TB; let Uses = [RDX, RAX] in { |

