mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-04 21:31:03 +00:00
MC/X86: Add custom hack for recognizing "imul $12, %eax" and friends.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111947 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e17edff28f
commit
ae528f65ba
@ -826,6 +826,14 @@ 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".
|
||||
if (Name.startswith("imul") && Operands.size() == 3 &&
|
||||
static_cast<X86Operand*>(Operands.back())->isReg()) {
|
||||
X86Operand *Op = static_cast<X86Operand*>(Operands.back());
|
||||
Operands.push_back(X86Operand::CreateReg(Op->getReg(), Op->getStartLoc(),
|
||||
Op->getEndLoc()));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -158,3 +158,6 @@ INT3
|
||||
// CHECK: movaps %xmm3, (%esi)
|
||||
// CHECK-STDERR: warning: scale factor without index register is ignored
|
||||
movaps %xmm3, (%esi, 2)
|
||||
|
||||
// CHECK: imull $12, %eax, %eax
|
||||
imul $12, %eax
|
||||
|
Loading…
x
Reference in New Issue
Block a user