diff options
author | Chris Lattner <sabre@nondot.org> | 2010-09-29 18:39:16 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-09-29 18:39:16 +0000 |
commit | a25f933396b8408ad89218bc60b0a93f130a3ea9 (patch) | |
tree | 46ef2e07f9b829c51f35508a83112a279e0a4d4a /lib | |
parent | 69daca59fff6c1275a52eb7d32948a88200a1807 (diff) |
implement rdar://8491845 - Gas supports commuted forms of non-commutable instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115061 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/X86/AsmParser/X86AsmParser.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp index c8b25cea30..3ecf273a08 100644 --- a/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -921,8 +921,10 @@ ParseInstruction(StringRef Name, SMLoc NameLoc, } // 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 && + // "f{mulp,addp} $op", since they commute. We also allow fdivrp/fsubrp even + // though they don't commute, solely because gas does support this. + if ((Name=="fmulp" || Name=="faddp" || Name=="fsubrp" || Name=="fdivrp") && + Operands.size() == 3 && static_cast<X86Operand*>(Operands[1])->isReg() && static_cast<X86Operand*>(Operands[1])->getReg() == X86::ST0) { delete Operands[1]; |