diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp index 2890cb1dee5..8cc5b693f17 100644 --- a/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -1196,7 +1196,7 @@ MatchAndEmitInstruction(SMLoc IDLoc, // 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 @@ MatchAndEmitInstruction(SMLoc IDLoc, .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 590f9681c3e..27df93626ee 100644 --- a/test/MC/X86/x86-32.s +++ b/test/MC/X86/x86-32.s @@ -774,3 +774,11 @@ pshufw $90, %mm4, %mm0 // 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