mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 16:24:23 +00:00
Fix a typo in the handling of PKHTB opcode, plus add sanity check for illegal register
encodings for DisassembleArithMiscFrm(). rdar://problem/9238659 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128958 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1474,6 +1474,12 @@ static bool DisassembleArithMiscFrm(MCInst &MI, unsigned Opcode, uint32_t insn,
|
||||
|
||||
bool ThreeReg = NumOps > 2 && OpInfo[2].RegClass == ARM::GPRRegClassID;
|
||||
|
||||
// Sanity check the registers, which should not be 15.
|
||||
if (decodeRd(insn) == 15 || decodeRm(insn) == 15)
|
||||
return false;
|
||||
if (ThreeReg && decodeRn(insn) == 15)
|
||||
return false;
|
||||
|
||||
MI.addOperand(MCOperand::CreateReg(getRegisterEnum(B, ARM::GPRRegClassID,
|
||||
decodeRd(insn))));
|
||||
++OpIdx;
|
||||
@ -1498,7 +1504,7 @@ static bool DisassembleArithMiscFrm(MCInst &MI, unsigned Opcode, uint32_t insn,
|
||||
ARM_AM::ShiftOpc Opc = ARM_AM::no_shift;
|
||||
if (Opcode == ARM::PKHBT)
|
||||
Opc = ARM_AM::lsl;
|
||||
else if (Opcode == ARM::PKHBT)
|
||||
else if (Opcode == ARM::PKHTB)
|
||||
Opc = ARM_AM::asr;
|
||||
getImmShiftSE(Opc, ShiftAmt);
|
||||
MI.addOperand(MCOperand::CreateImm(ARM_AM::getSORegOpc(Opc, ShiftAmt)));
|
||||
|
Reference in New Issue
Block a user