[llvm-commits] [llvm] r115154 - in /llvm/trunk: lib/Target/X86/AsmParser/X86AsmParser.cpp test/MC/AsmParser/X86/x86_instructions.s
Chris Lattner
sabre at nondot.org
Thu Sep 30 09:39:30 PDT 2010
Author: lattner
Date: Thu Sep 30 11:39:29 2010
New Revision: 115154
URL: http://llvm.org/viewvc/llvm-project?rev=115154&view=rev
Log:
add support for fstcw, PR8259
Modified:
llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
llvm/trunk/test/MC/AsmParser/X86/x86_instructions.s
Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=115154&r1=115153&r2=115154&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Thu Sep 30 11:39:29 2010
@@ -1119,13 +1119,19 @@
// 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);
}
Modified: llvm/trunk/test/MC/AsmParser/X86/x86_instructions.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_instructions.s?rev=115154&r1=115153&r2=115154&view=diff
==============================================================================
--- llvm/trunk/test/MC/AsmParser/X86/x86_instructions.s (original)
+++ llvm/trunk/test/MC/AsmParser/X86/x86_instructions.s Thu Sep 30 11:39:29 2010
@@ -416,6 +416,11 @@
// CHECK: wait
// CHECK: fnstsw (%rax)
+// PR8259
+fstcw (%rsp)
+// CHECK: wait
+// CHECK: fnstcw (%rsp)
+
// rdar://8456382 - cvtsd2si support.
cvtsd2si %xmm1, %rax
@@ -474,3 +479,4 @@
fsubrp %ST(0), %ST(1) // CHECK: encoding: [0xde,0xe9]
fsubrp %ST(1), %ST(0) // CHECK: encoding: [0xde,0xe9]
+
More information about the llvm-commits
mailing list