Separate out Thumb1 instructions that need an S bit operand from those that do not...
authorOwen Anderson <resistor@mac.com>
Tue, 16 Aug 2011 23:45:44 +0000 (23:45 +0000)
committerOwen Anderson <resistor@mac.com>
Tue, 16 Aug 2011 23:45:44 +0000 (23:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137787 91177308-0d34-0410-b5e6-96231b3b80d8

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

index fecc6bfdef8451a33c69559e58c844243f39f96e..ef5834b0acf821dd0b959f111386fb250ded45f1 100644 (file)
@@ -902,6 +902,7 @@ class Thumb1sI<dag oops, dag iops, AddrMode am, int sz,
   let Pattern = pattern;
   let thumbArithFlagSetting = 1;
   list<Predicate> Predicates = [IsThumb, IsThumb1Only];
+  let DecoderNamespace = "ThumbSBit";
 }
 
 class T1sI<dag oops, dag iops, InstrItinClass itin,
index 28dd986d65e8854343fdcaef3ac958ac1758df3d..cb7a45a25720de730a2e3aee1cf345390848c315 100644 (file)
@@ -415,6 +415,14 @@ bool ThumbDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
 
   uint16_t insn16 = (bytes[1] << 8) | bytes[0];
   bool result = decodeThumbInstruction16(MI, insn16, Address, this);
+  if (result) {
+    Size = 2;
+    AddThumbPredicate(MI);
+    return true;
+  }
+
+  MI.clear();
+  result = decodeThumbSBitInstruction16(MI, insn16, Address, this);
   if (result) {
     Size = 2;
     bool InITBlock = !ITBlock.empty();