mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
Fix the handling of edge cases in ARM shifted operands.
This patch fixes load/store instructions to handle less common cases like "asr #32", "rrx" properly throughout the MC layer. Patch by Chris Lidbury. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164455 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1523,6 +1523,8 @@ DecodeAddrMode2IdxInstruction(MCInst &Inst, unsigned Insn,
|
||||
return MCDisassembler::Fail;
|
||||
}
|
||||
unsigned amt = fieldFromInstruction(Insn, 7, 5);
|
||||
if (Opc == ARM_AM::ror && amt == 0)
|
||||
Opc = ARM_AM::rrx;
|
||||
unsigned imm = ARM_AM::getAM2Opc(Op, amt, Opc, idx_mode);
|
||||
|
||||
Inst.addOperand(MCOperand::CreateImm(imm));
|
||||
@@ -1564,6 +1566,9 @@ static DecodeStatus DecodeSORegMemOperand(MCInst &Inst, unsigned Val,
|
||||
break;
|
||||
}
|
||||
|
||||
if (ShOp == ARM_AM::ror && imm == 0)
|
||||
ShOp = ARM_AM::rrx;
|
||||
|
||||
if (!Check(S, DecodeGPRRegisterClass(Inst, Rn, Address, Decoder)))
|
||||
return MCDisassembler::Fail;
|
||||
if (!Check(S, DecodeGPRRegisterClass(Inst, Rm, Address, Decoder)))
|
||||
|
||||
Reference in New Issue
Block a user