[llvm-commits] [llvm] r138443 - in /llvm/trunk/lib/Target/ARM: ARMInstrThumb2.td Disassembler/ARMDisassembler.cpp
Owen Anderson
resistor at mac.com
Wed Aug 24 10:21:44 PDT 2011
Author: resistor
Date: Wed Aug 24 12:21:43 2011
New Revision: 138443
URL: http://llvm.org/viewvc/llvm-project?rev=138443&view=rev
Log:
Be stricter in enforcing IT instruction predicate values, so that we don't end up trying to print out an illegal predicate.
Modified:
llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td?rev=138443&r1=138442&r2=138443&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td Wed Aug 24 12:21:43 2011
@@ -14,6 +14,7 @@
// IT block predicate field
def it_pred : Operand<i32> {
let PrintMethod = "printMandatoryPredicateOperand";
+ let DecoderMethod = "DecodeITCond";
}
// IT block condition mask
Modified: llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp?rev=138443&r1=138442&r2=138443&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp Wed Aug 24 12:21:43 2011
@@ -228,6 +228,8 @@
uint64_t Address, const void *Decoder);
static DecodeStatus DecodeThumbBLTargetOperand(llvm::MCInst &Inst, unsigned Val,
uint64_t Address, const void *Decoder);
+static DecodeStatus DecodeITCond(llvm::MCInst &Inst, unsigned Val,
+ uint64_t Address, const void *Decoder);
#include "ARMGenDisassemblerTables.inc"
#include "ARMGenInstrInfo.inc"
@@ -3289,3 +3291,15 @@
return S;
}
+static DecodeStatus DecodeITCond(llvm::MCInst &Inst, unsigned Cond,
+ uint64_t Address, const void *Decoder) {
+ DecodeStatus S = Success;
+ if (Cond == 0xF) {
+ Cond = 0xE;
+ CHECK(S, Unpredictable);
+ }
+
+ Inst.addOperand(MCOperand::CreateImm(Cond));
+ return S;
+}
+
More information about the llvm-commits
mailing list