[llvm-commits] [llvm] r114818 - in /llvm/trunk: lib/Target/X86/AsmParser/X86AsmParser.cpp test/MC/AsmParser/X86/x86_instructions.s
Chris Lattner
sabre at nondot.org
Mon Sep 27 00:08:21 PDT 2010
Author: lattner
Date: Mon Sep 27 02:08:21 2010
New Revision: 114818
URL: http://llvm.org/viewvc/llvm-project?rev=114818&view=rev
Log:
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.
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=114818&r1=114817&r2=114818&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Mon Sep 27 02:08:21 2010
@@ -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];
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=114818&r1=114817&r2=114818&view=diff
==============================================================================
--- llvm/trunk/test/MC/AsmParser/X86/x86_instructions.s (original)
+++ llvm/trunk/test/MC/AsmParser/X86/x86_instructions.s Mon Sep 27 02:08:21 2010
@@ -360,6 +360,22 @@
faddp %st, %st(1)
fmulp %st, %st(2)
+// rdar://8468087 - Encode these accurately, they are not synonyms.
+// CHECK: fmul %st(0), %st(1)
+// CHECK: encoding: [0xdc,0xc9]
+// CHECK: fmul %st(1)
+// CHECK: encoding: [0xd8,0xc9]
+fmul %st, %st(1)
+fmul %st(1), %st
+
+// CHECK: fadd %st(0), %st(1)
+// CHECK: encoding: [0xdc,0xc1]
+// CHECK: fadd %st(1)
+// CHECK: encoding: [0xd8,0xc1]
+fadd %st, %st(1)
+fadd %st(1), %st
+
+
// rdar://8416805
// CHECK: xorb %al, %al
// CHECK: encoding: [0x30,0xc0]
More information about the llvm-commits
mailing list