IMULri* instructions do not require their first two registers operands
to be the same (IOW they are not two address instructions).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11117 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp
index 5ac5c78..7cd4573 100644
--- a/lib/Target/X86/X86AsmPrinter.cpp
+++ b/lib/Target/X86/X86AsmPrinter.cpp
@@ -666,8 +666,8 @@
// ModR/M input. The first two operands should be the same, post register
// allocation. This is for things like: add r32, r/m32
//
- // 3 Operands: in this form, we can have 'INST R, R, imm', which is used for
- // instructions like the IMULri instructions.
+ // 3 Operands: in this form, we can have 'INST R1, R2, imm', which is used
+ // for instructions like the IMULri instructions.
//
// 2 Operands: this is for things like mov that do not read a second input
//
@@ -678,7 +678,7 @@
(MI->getOperand(2).isRegister() ||
MI->getOperand(2).isImmediate())))
&& "Bad format for MRMSrcReg!");
- if (MI->getNumOperands() == 3 &&
+ if (MI->getNumOperands() == 3 && !MI->getOperand(2).isImmediate() &&
MI->getOperand(0).getReg() != MI->getOperand(1).getReg())
O << "**";