mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-17 03:30:28 +00:00
Thumb disassembler did not handle tBRIND (indirect branch) properly.
rdar://problem/9280370 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129480 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
be0761c820
commit
e8d087ad35
@ -479,6 +479,7 @@ static bool DisassembleThumb1DP(MCInst &MI, unsigned Opcode, uint32_t insn,
|
||||
// tBX_RET: 0 operand
|
||||
// tBX_RET_vararg: Rm
|
||||
// tBLXr_r9: Rm
|
||||
// tBRIND: Rm
|
||||
static bool DisassembleThumb1Special(MCInst &MI, unsigned Opcode, uint32_t insn,
|
||||
unsigned short NumOps, unsigned &NumOpsAdded, BO B) {
|
||||
|
||||
@ -486,14 +487,17 @@ static bool DisassembleThumb1Special(MCInst &MI, unsigned Opcode, uint32_t insn,
|
||||
if (NumOps == 0)
|
||||
return true;
|
||||
|
||||
// BX/BLX has 1 reg operand: Rm.
|
||||
if (Opcode == ARM::tBLXr_r9 || Opcode == ARM::tBX_Rm) {
|
||||
// Handling the two predicate operands before the reg operand.
|
||||
if (!B->DoPredicateOperands(MI, Opcode, insn, NumOps))
|
||||
return false;
|
||||
// BX/BLX/tBRIND (indirect branch, i.e, mov pc, Rm) has 1 reg operand: Rm.
|
||||
if (Opcode==ARM::tBLXr_r9 || Opcode==ARM::tBX_Rm || Opcode==ARM::tBRIND) {
|
||||
if (Opcode != ARM::tBRIND) {
|
||||
// Handling the two predicate operands before the reg operand.
|
||||
if (!B->DoPredicateOperands(MI, Opcode, insn, NumOps))
|
||||
return false;
|
||||
NumOpsAdded += 2;
|
||||
}
|
||||
MI.addOperand(MCOperand::CreateReg(getRegisterEnum(B, ARM::GPRRegClassID,
|
||||
getT1Rm(insn))));
|
||||
NumOpsAdded = 3;
|
||||
NumOpsAdded += 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -244,3 +244,6 @@
|
||||
|
||||
# CHECK: mov.w r3, #4294967295
|
||||
0x4f 0xf0 0xff 0x33
|
||||
|
||||
# CHECK: mov pc, sp
|
||||
0xef 0x46
|
||||
|
Loading…
Reference in New Issue
Block a user