implement support for finit, PR8258
authorChris Lattner <sabre@nondot.org>
Thu, 30 Sep 2010 16:42:53 +0000 (16:42 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 30 Sep 2010 16:42:53 +0000 (16:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115156 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/AsmParser/X86AsmParser.cpp
test/MC/AsmParser/X86/x86_instructions.s

index e028d41ea8cd36285abf8c7731a7d9c1b958a26c..dc86484bd4aaed17fe9411ae69946df198c82158 100644 (file)
@@ -1119,7 +1119,8 @@ MatchAndEmitInstruction(SMLoc IDLoc,
 
   // First, handle aliases that expand to multiple instructions.
   // FIXME: This should be replaced with a real .td file alias mechanism.
-  if (Op->getToken() == "fstsw" || Op->getToken() == "fstcw") {
+  if (Op->getToken() == "fstsw" || Op->getToken() == "fstcw" ||
+      Op->getToken() == "finit") {
     MCInst Inst;
     Inst.setOpcode(X86::WAIT);
     Out.EmitInstruction(Inst);
@@ -1129,6 +1130,7 @@ MatchAndEmitInstruction(SMLoc IDLoc,
       StringSwitch<const char*>(Op->getToken())
         .Case("fstsw", "fnstsw")
         .Case("fstcw", "fnstcw")
+        .Case("finit", "fninit")
         .Default(0);
     assert(Repl && "Unknown wait-prefixed instruction");
     Operands[0] = X86Operand::CreateToken(Repl, IDLoc);
index b2ac5ad4562a3c03ada6252c0b4726af696be1a4..4731a0857de1301c81638a6dd5c90ef16e7cb11a 100644 (file)
@@ -421,6 +421,16 @@ fstcw (%rsp)
 // CHECK: wait
 // CHECK: fnstcw (%rsp)
 
+// PR8259
+fstcw (%rsp)
+// CHECK: wait
+// CHECK: fnstcw (%rsp)
+
+// PR8258
+finit
+// CHECK: wait
+// CHECK: fninit
+
 
 // rdar://8456382 - cvtsd2si support.
 cvtsd2si       %xmm1, %rax