Fix rdar://8468087 - llvm-mc commutes fmul (and friend) operands.
My previous fix for rdar://8456371 should only apply to fmulp/faddp,
not to fmul/fadd. Instruction set orthogonality is overrated or
something.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114818 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp
index 18fb173..698e282 100644
--- a/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -910,11 +910,10 @@
delete Operands[2];
Operands.erase(Operands.begin() + 2);
}
-
- // FIXME: Hack to handle "f{mul*,add*} st(0), $op" the same as
- // "f{mul*,add*} $op", since they commute.
- if ((Name.startswith("fmul") || Name.startswith("fadd")) &&
- Operands.size() == 3 &&
+
+ // FIXME: Hack to handle "f{mulp,addp} st(0), $op" the same as
+ // "f{mulp,addp} $op", since they commute.
+ if ((Name == "fmulp" || Name == "faddp") && Operands.size() == 3 &&
static_cast<X86Operand*>(Operands[1])->isReg() &&
static_cast<X86Operand*>(Operands[1])->getReg() == X86::ST0) {
delete Operands[1];