Another tweak to X86 instructions to add the missing flex instruction (without
the wait prefix).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117434 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp
index 2890cb1..8cc5b69 100644
--- a/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -1196,7 +1196,7 @@
// FIXME: This should be replaced with a real .td file alias mechanism.
if (Op->getToken() == "fstsw" || Op->getToken() == "fstcw" ||
Op->getToken() == "finit" || Op->getToken() == "fsave" ||
- Op->getToken() == "fstenv") {
+ Op->getToken() == "fstenv" || Op->getToken() == "fclex") {
MCInst Inst;
Inst.setOpcode(X86::WAIT);
Out.EmitInstruction(Inst);
@@ -1208,6 +1208,7 @@
.Case("fstcw", "fnstcw")
.Case("fstenv", "fnstenv")
.Case("fstsw", "fnstsw")
+ .Case("fclex", "fnclex")
.Default(0);
assert(Repl && "Unknown wait-prefixed instruction");
delete Operands[0];
diff --git a/test/MC/X86/x86-32.s b/test/MC/X86/x86-32.s
index 590f968..27df936 100644
--- a/test/MC/X86/x86-32.s
+++ b/test/MC/X86/x86-32.s
@@ -774,3 +774,11 @@
// CHECK: verr 32493
// CHECK: encoding: [0x0f,0x00,0x25,0xed,0x7e,0x00,0x00]
verr 0x7eed
+
+// CHECK: wait
+// CHECK: encoding: [0x9b]
+ fclex
+
+// CHECK: fnclex
+// CHECK: encoding: [0xdb,0xe2]
+ fnclex