Perform more thorough checking of t2IT mask parameters, which fixes all remaining...
authorOwen Anderson <resistor@mac.com>
Wed, 24 Aug 2011 22:40:22 +0000 (22:40 +0000)
committerOwen Anderson <resistor@mac.com>
Wed, 24 Aug 2011 22:40:22 +0000 (22:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138507 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMInstrThumb2.td
lib/Target/ARM/Disassembler/ARMDisassembler.cpp

index d7e92db89df5595c3a63ef496d258fe4ee797419..bb6b7672b8aea810dfdb9d9ce47fa3f61cfd1a2a 100644 (file)
@@ -20,6 +20,7 @@ def it_pred : Operand<i32> {
 // IT block condition mask
 def it_mask : Operand<i32> {
   let PrintMethod = "printThumbITMask";
+  let DecoderMethod = "DecodeITMask";
 }
 
 // Shifted operands. No register controlled shifts for Thumb2.
index e22126956e7a1c3264f706fad8a4a9ae1ca7af35..83a8f800608e0cf47a0e9d68ae1a42b7dd2fb2d1 100644 (file)
@@ -230,6 +230,8 @@ 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);
+static DecodeStatus DecodeITMask(llvm::MCInst &Inst, unsigned Val,
+                                uint64_t Address, const void *Decoder);
 
 #include "ARMGenDisassemblerTables.inc"
 #include "ARMGenInstrInfo.inc"
@@ -3304,3 +3306,14 @@ static DecodeStatus DecodeITCond(llvm::MCInst &Inst, unsigned Cond,
   return S;
 }
 
+static DecodeStatus DecodeITMask(llvm::MCInst &Inst, unsigned Mask,
+                                 uint64_t Address, const void *Decoder) {
+  DecodeStatus S = Success;
+  if (Mask == 0) {
+    Mask = 0x8;
+    CHECK(S, Unpredictable);
+  }
+  Inst.addOperand(MCOperand::CreateImm(Mask));
+  return S;
+}
+