1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

MC/X86: Tweak imul recognition, previous hack only applies for the imul form

taking immediates.

llvm-svn: 111950
This commit is contained in:
Daniel Dunbar 2010-08-24 19:37:56 +00:00
parent 2dfd959d32
commit b96b0c40d3
2 changed files with 6 additions and 1 deletions

View File

@ -826,8 +826,10 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
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(),

View File

@ -161,3 +161,6 @@ movaps %xmm3, (%esi, 2)
// CHECK: imull $12, %eax, %eax
imul $12, %eax
// CHECK: imull %ecx, %eax
imull %ecx, %eax