fix rdar://8456389 - llvm-mc mismatch with 'as' on 'fstp'
authorChris Lattner <sabre@nondot.org>
Wed, 22 Sep 2010 04:04:03 +0000 (04:04 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 22 Sep 2010 04:04:03 +0000 (04:04 +0000)
-This line, and those below, will be ignored--

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114527 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 4c51ed674e3bc8536e50e0da6a3ad60b6d4eff5c..d8650e0604529936fb6adae5346baddaa494b6c4 100644 (file)
@@ -1015,6 +1015,14 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
     Operands[0] = X86Operand::CreateToken("movsl", NameLoc);
   }
   
+  // fstp <mem> -> fstps <mem>.  Without this, we'll default to fstpl due to
+  // suffix searching.
+  if (Name == "fstp" && Operands.size() == 2 &&
+      static_cast<X86Operand*>(Operands[1])->isMem()) {
+    delete Operands[0];
+    Operands[0] = X86Operand::CreateToken("fstps", NameLoc);
+  }
+  
   return false;
 }
 
index 7f8a401c076f7106caab3b2764e64399b365883f..207de850e7d8954c1412cf0d66dddd49c3b793a8 100644 (file)
@@ -310,3 +310,9 @@ enter $0x7ace,$0
 enter $0x7ace,$1
 enter $0x7ace,$0x7f
 
+
+// rdar://8456389
+// CHECK: fstps        (%eax)
+// CHECK: encoding: [0xd9,0x18]
+fstp   (%eax)
+