summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2011-02-28 18:46:31 +0000
committerKevin Enderby <enderby@apple.com>2011-02-28 18:46:31 +0000
commit58775fea6fe925ccb5da549b79472bfa00709a78 (patch)
treea200f7c5fe12baa21d2f3a804835e4cb38d752d4 /llvm/lib
parent6e3d44364608f1e10ddfb4c55e1f3590ff5f266d (diff)
downloadbcm5719-llvm-58775fea6fe925ccb5da549b79472bfa00709a78.tar.gz
bcm5719-llvm-58775fea6fe925ccb5da549b79472bfa00709a78.zip
Fix the arm's disassembler for blx that was building an MCInst without the
needed two predicate operands before the imm operand. llvm-svn: 126662
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h b/llvm/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h
index 23372e02241..074561c02d6 100644
--- a/llvm/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h
+++ b/llvm/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h
@@ -1719,6 +1719,17 @@ static bool DisassembleThumb2BrMiscCtrl(MCInst &MI, unsigned Opcode,
return true;
}
+ // Some instructions have predicate operands first before the immediate.
+ if(Opcode == ARM::tBLXi_r9 || Opcode == ARM::tBLr9) {
+ // Handling the two predicate operands before the imm operand.
+ if (B->DoPredicateOperands(MI, Opcode, insn, NumOps))
+ NumOpsAdded += 2;
+ else {
+ DEBUG(errs() << "Expected predicate operands not found.\n");
+ return false;
+ }
+ }
+
// Add the imm operand.
int Offset = 0;
@@ -1745,7 +1756,8 @@ static bool DisassembleThumb2BrMiscCtrl(MCInst &MI, unsigned Opcode,
// to compensate.
MI.addOperand(MCOperand::CreateImm(Offset + 4));
- NumOpsAdded = 1;
+ // This is an increment as some predicate operands may have been added first.
+ NumOpsAdded += 1;
return true;
}
OpenPOWER on IntegriCloud