summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2011-08-16 23:45:44 +0000
committerOwen Anderson <resistor@mac.com>2011-08-16 23:45:44 +0000
commit91a8f9be203b7aac0fe58d6c0f577f62d70c03df (patch)
tree92461fd9b99724ae4e1c28feef0b3109eaf50753 /llvm/lib/Target/ARM
parente1df253200269a4e4880ffe7cf8a4d1981e0e40f (diff)
downloadbcm5719-llvm-91a8f9be203b7aac0fe58d6c0f577f62d70c03df.tar.gz
bcm5719-llvm-91a8f9be203b7aac0fe58d6c0f577f62d70c03df.zip
Separate out Thumb1 instructions that need an S bit operand from those that do not, for the purposes of decoding them.
llvm-svn: 137787
Diffstat (limited to 'llvm/lib/Target/ARM')
-rw-r--r--llvm/lib/Target/ARM/ARMInstrFormats.td1
-rw-r--r--llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp8
2 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMInstrFormats.td b/llvm/lib/Target/ARM/ARMInstrFormats.td
index fecc6bfdef8..ef5834b0acf 100644
--- a/llvm/lib/Target/ARM/ARMInstrFormats.td
+++ b/llvm/lib/Target/ARM/ARMInstrFormats.td
@@ -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,
diff --git a/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp b/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
index 28dd986d65e..cb7a45a2572 100644
--- a/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
+++ b/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
@@ -417,6 +417,14 @@ bool ThumbDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
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();
AddThumbPredicate(MI);
AddThumb1SBit(MI, InITBlock);
OpenPOWER on IntegriCloud