mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-21 03:32:29 +00:00
implement aliases for shld/shrd, part of rdar://8418316
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113937 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e9e16a36d9
commit
cfad564043
@ -833,6 +833,15 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
|
||||
Operands.push_back(X86Operand::CreateImm(One, NameLoc, NameLoc));
|
||||
std::swap(Operands[1], Operands[2]);
|
||||
}
|
||||
|
||||
// FIXME: Hack to handle recognize "sh[lr]d op,op" -> "shld $1, op,op".
|
||||
if ((Name.startswith("shld") || Name.startswith("shrd")) &&
|
||||
Operands.size() == 3) {
|
||||
const MCExpr *One = MCConstantExpr::Create(1, getParser().getContext());
|
||||
Operands.insert(Operands.begin()+1,
|
||||
X86Operand::CreateImm(One, NameLoc, NameLoc));
|
||||
}
|
||||
|
||||
|
||||
// FIXME: Hack to handle recognize "in[bwl] <op>". Canonicalize it to
|
||||
// "inb <op>, %al".
|
||||
|
@ -268,3 +268,14 @@ rcl %bl
|
||||
rcll 0xdeadbeef(%ebx,%ecx,8)
|
||||
rcr %ecx
|
||||
rcrl 0x12345678
|
||||
|
||||
// rdar://8418316
|
||||
// CHECK: shldw $1, %bx, %bx
|
||||
// CHECK: shldw $1, %bx, %bx
|
||||
// CHECK: shrdw $1, %bx, %bx
|
||||
// CHECK: shrdw $1, %bx, %bx
|
||||
|
||||
shld %bx,%bx
|
||||
shld $1, %bx,%bx
|
||||
shrd %bx,%bx
|
||||
shrd $1, %bx,%bx
|
||||
|
Loading…
x
Reference in New Issue
Block a user