]> granicus.if.org Git - llvm/commitdiff
[X86] Re-disable cmpxchg16b for 32-bit mode assembly parsing.
authorCraig Topper <craig.topper@intel.com>
Tue, 19 Mar 2019 23:57:16 +0000 (23:57 +0000)
committerCraig Topper <craig.topper@intel.com>
Tue, 19 Mar 2019 23:57:16 +0000 (23:57 +0000)
This was broken recently when I factored the 64 bit mode check into hasCmpxchg16 without thinking about the AssemblerPredicate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356531 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86InstrCompiler.td
lib/Target/X86/X86InstrInfo.td
test/MC/X86/x86_errors.s

index e7a0383a254a8377cd2f41acbbd53d3fcf54b473..16afcf6330b0e7ace153232b5ac909adcc1e11d3 100644 (file)
@@ -903,14 +903,14 @@ def LCMPXCHG8B_SAVE_EBX :
 
 
 let Defs = [RAX, RDX, EFLAGS], Uses = [RAX, RBX, RCX, RDX],
-    Predicates = [HasCmpxchg16b], SchedRW = [WriteCMPXCHGRMW] in {
+    Predicates = [HasCmpxchg16b,In64BitMode], SchedRW = [WriteCMPXCHGRMW] in {
 defm LCMPXCHG16B : LCMPXCHG_UnOp<0xC7, MRM1m, "cmpxchg16b",
                                  X86cas16, i128mem>, REX_W;
 }
 
 // Same as LCMPXCHG8B_SAVE_RBX but for the 16 Bytes variant.
 let Defs = [RAX, RDX, RBX, EFLAGS], Uses = [RAX, RCX, RDX],
-    Predicates = [HasCmpxchg16b], SchedRW = [WriteCMPXCHGRMW],
+    Predicates = [HasCmpxchg16b,In64BitMode], SchedRW = [WriteCMPXCHGRMW],
     isCodeGenOnly = 1, isPseudo = 1, Constraints = "$rbx_save = $dst",
     usesCustomInserter = 1 in {
 def LCMPXCHG16B_SAVE_RBX :
index be5085b6523bc26da16875ef386507a2c1d4b784..5d24511042c2e6ae900363cfad83552fb2aef837 100644 (file)
@@ -2083,9 +2083,10 @@ def CMPXCHG8B : I<0xC7, MRM1m, (outs), (ins i64mem:$dst),
                   "cmpxchg8b\t$dst", []>, TB;
 
 let Defs = [RAX, RDX, EFLAGS], Uses = [RAX, RBX, RCX, RDX] in
+// NOTE: In64BitMode check needed for the AssemblerPredicate.
 def CMPXCHG16B : RI<0xC7, MRM1m, (outs), (ins i128mem:$dst),
                     "cmpxchg16b\t$dst", []>,
-                    TB, Requires<[HasCmpxchg16b]>;
+                    TB, Requires<[HasCmpxchg16b,In64BitMode]>;
 } // SchedRW, mayLoad, mayStore, hasSideEffects
 
 
index 273abd57fba6db873eea300957b32503a2051d81..74893a57d952d05e9d71526b3d80a1688974f3e4 100644 (file)
@@ -164,3 +164,6 @@ cqto
 
 // 32: error: instruction requires: 64-bit mode
 cltq
+
+// 32: error: instruction requires: 64-bit mode
+cmpxchg16b (%eax)