// First, handle aliases that expand to multiple instructions.
// FIXME: This should be replaced with a real .td file alias mechanism.
- if (Op->getToken() == "fstsw") {
+ if (Op->getToken() == "fstsw" || Op->getToken() == "fstcw") {
MCInst Inst;
Inst.setOpcode(X86::WAIT);
Out.EmitInstruction(Inst);
delete Operands[0];
- Operands[0] = X86Operand::CreateToken("fnstsw", IDLoc);
+ const char *Repl =
+ StringSwitch<const char*>(Op->getToken())
+ .Case("fstsw", "fnstsw")
+ .Case("fstcw", "fnstcw")
+ .Default(0);
+ assert(Repl && "Unknown wait-prefixed instruction");
+ Operands[0] = X86Operand::CreateToken(Repl, IDLoc);
}
// CHECK: wait
// CHECK: fnstsw (%rax)
+// PR8259
+fstcw (%rsp)
+// CHECK: wait
+// CHECK: fnstcw (%rsp)
+
// rdar://8456382 - cvtsd2si support.
cvtsd2si %xmm1, %rax
fsubrp %ST(0), %ST(1) // CHECK: encoding: [0xde,0xe9]
fsubrp %ST(1), %ST(0) // CHECK: encoding: [0xde,0xe9]
+