summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Target/X86/AsmParser/X86AsmParser.cpp8
-rw-r--r--test/MC/AsmParser/X86/x86_instructions.s6
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp
index 4c51ed674e..d8650e0604 100644
--- a/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -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;
}
diff --git a/test/MC/AsmParser/X86/x86_instructions.s b/test/MC/AsmParser/X86/x86_instructions.s
index 7f8a401c07..207de850e7 100644
--- a/test/MC/AsmParser/X86/x86_instructions.s
+++ b/test/MC/AsmParser/X86/x86_instructions.s
@@ -310,3 +310,9 @@ enter $0x7ace,$0
enter $0x7ace,$1
enter $0x7ace,$0x7f
+
+// rdar://8456389
+// CHECK: fstps (%eax)
+// CHECK: encoding: [0xd9,0x18]
+fstp (%eax)
+