[llvm-commits] [llvm] r111950 - in /llvm/trunk: lib/Target/X86/AsmParser/X86AsmParser.cpp test/MC/AsmParser/X86/x86_instructions.s

Daniel Dunbar daniel at zuster.org
Tue Aug 24 12:37:56 PDT 2010


Author: ddunbar
Date: Tue Aug 24 14:37:56 2010
New Revision: 111950

URL: http://llvm.org/viewvc/llvm-project?rev=111950&view=rev
Log:
MC/X86: Tweak imul recognition, previous hack only applies for the imul form
taking immediates.

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=111950&r1=111949&r2=111950&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Tue Aug 24 14:37:56 2010
@@ -826,8 +826,10 @@
     Operands.erase(Operands.begin() + 2);
   }
 
-  // FIXME: Hack to handle "imul A, B" which is an alias for "imul A, B, B".
+  // FIXME: Hack to handle "imul <imm>, B" which is an alias for "imul <imm>, B,
+  // B".
   if (Name.startswith("imul") && Operands.size() == 3 &&
+      static_cast<X86Operand*>(Operands[1])->isImm() &&
       static_cast<X86Operand*>(Operands.back())->isReg()) {
     X86Operand *Op = static_cast<X86Operand*>(Operands.back());
     Operands.push_back(X86Operand::CreateReg(Op->getReg(), Op->getStartLoc(),

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=111950&r1=111949&r2=111950&view=diff
==============================================================================
--- llvm/trunk/test/MC/AsmParser/X86/x86_instructions.s (original)
+++ llvm/trunk/test/MC/AsmParser/X86/x86_instructions.s Tue Aug 24 14:37:56 2010
@@ -161,3 +161,6 @@
 
 // CHECK: imull $12, %eax, %eax
 imul $12, %eax
+
+// CHECK: imull %ecx, %eax
+imull %ecx, %eax





More information about the llvm-commits mailing list