[llvm-commits] [llvm] r126662 - in /llvm/trunk: lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h test/MC/Disassembler/ARM/thumb-tests.txt
Kevin Enderby
enderby at apple.com
Mon Feb 28 10:46:32 PST 2011
Author: enderby
Date: Mon Feb 28 12:46:31 2011
New Revision: 126662
URL: http://llvm.org/viewvc/llvm-project?rev=126662&view=rev
Log:
Fix the arm's disassembler for blx that was building an MCInst without the
needed two predicate operands before the imm operand.
Modified:
llvm/trunk/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h
llvm/trunk/test/MC/Disassembler/ARM/thumb-tests.txt
Modified: llvm/trunk/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h?rev=126662&r1=126661&r2=126662&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h (original)
+++ llvm/trunk/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h Mon Feb 28 12:46:31 2011
@@ -1719,6 +1719,17 @@
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 @@
// 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;
}
Modified: llvm/trunk/test/MC/Disassembler/ARM/thumb-tests.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/ARM/thumb-tests.txt?rev=126662&r1=126661&r2=126662&view=diff
==============================================================================
--- llvm/trunk/test/MC/Disassembler/ARM/thumb-tests.txt (original)
+++ llvm/trunk/test/MC/Disassembler/ARM/thumb-tests.txt Mon Feb 28 12:46:31 2011
@@ -118,3 +118,6 @@
# CHECK: msr cpsr_fc, r0
0x80 0xf3 0x00 0x89
+
+# CHECK: blx #0
+0xff 0xf7 0xfe 0xef
More information about the llvm-commits
mailing list