mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-12 01:25:49 +00:00
MC/X86: Tweak imul recognition, previous hack only applies for the imul form
taking immediates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111950 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -826,8 +826,10 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
|
|||||||
Operands.erase(Operands.begin() + 2);
|
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 &&
|
if (Name.startswith("imul") && Operands.size() == 3 &&
|
||||||
|
static_cast<X86Operand*>(Operands[1])->isImm() &&
|
||||||
static_cast<X86Operand*>(Operands.back())->isReg()) {
|
static_cast<X86Operand*>(Operands.back())->isReg()) {
|
||||||
X86Operand *Op = static_cast<X86Operand*>(Operands.back());
|
X86Operand *Op = static_cast<X86Operand*>(Operands.back());
|
||||||
Operands.push_back(X86Operand::CreateReg(Op->getReg(), Op->getStartLoc(),
|
Operands.push_back(X86Operand::CreateReg(Op->getReg(), Op->getStartLoc(),
|
||||||
|
@@ -161,3 +161,6 @@ movaps %xmm3, (%esi, 2)
|
|||||||
|
|
||||||
// CHECK: imull $12, %eax, %eax
|
// CHECK: imull $12, %eax, %eax
|
||||||
imul $12, %eax
|
imul $12, %eax
|
||||||
|
|
||||||
|
// CHECK: imull %ecx, %eax
|
||||||
|
imull %ecx, %eax
|
||||||
|
Reference in New Issue
Block a user