[X86] Re-disable cmpxchg16b for 32-bit mode assembly parsing.

This was broken recently when I factored the 64 bit mode check into hasCmpxchg16 without thinking about the AssemblerPredicate.

llvm-svn: 356531
This commit is contained in:
Craig Topper 2019-03-19 23:57:16 +00:00
parent 91e150d54c
commit 97d104cbee
3 changed files with 7 additions and 3 deletions

View File

@ -903,14 +903,14 @@ def LCMPXCHG8B_SAVE_EBX :
let Defs = [RAX, RDX, EFLAGS], Uses = [RAX, RBX, RCX, RDX], 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", defm LCMPXCHG16B : LCMPXCHG_UnOp<0xC7, MRM1m, "cmpxchg16b",
X86cas16, i128mem>, REX_W; X86cas16, i128mem>, REX_W;
} }
// Same as LCMPXCHG8B_SAVE_RBX but for the 16 Bytes variant. // Same as LCMPXCHG8B_SAVE_RBX but for the 16 Bytes variant.
let Defs = [RAX, RDX, RBX, EFLAGS], Uses = [RAX, RCX, RDX], 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", isCodeGenOnly = 1, isPseudo = 1, Constraints = "$rbx_save = $dst",
usesCustomInserter = 1 in { usesCustomInserter = 1 in {
def LCMPXCHG16B_SAVE_RBX : def LCMPXCHG16B_SAVE_RBX :

View File

@ -2083,9 +2083,10 @@ def CMPXCHG8B : I<0xC7, MRM1m, (outs), (ins i64mem:$dst),
"cmpxchg8b\t$dst", []>, TB; "cmpxchg8b\t$dst", []>, TB;
let Defs = [RAX, RDX, EFLAGS], Uses = [RAX, RBX, RCX, RDX] in 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), def CMPXCHG16B : RI<0xC7, MRM1m, (outs), (ins i128mem:$dst),
"cmpxchg16b\t$dst", []>, "cmpxchg16b\t$dst", []>,
TB, Requires<[HasCmpxchg16b]>; TB, Requires<[HasCmpxchg16b,In64BitMode]>;
} // SchedRW, mayLoad, mayStore, hasSideEffects } // SchedRW, mayLoad, mayStore, hasSideEffects

View File

@ -164,3 +164,6 @@ cqto
// 32: error: instruction requires: 64-bit mode // 32: error: instruction requires: 64-bit mode
cltq cltq
// 32: error: instruction requires: 64-bit mode
cmpxchg16b (%eax)