diff options
author | Owen Anderson <resistor@mac.com> | 2011-08-10 19:01:10 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2011-08-10 19:01:10 +0000 |
commit | 8533ebad6f6e407215497ca50771f323058f5576 (patch) | |
tree | a8e38c101abbe424fbe89dc58eccac41f7615d79 /lib/Target/ARM/Disassembler/ARMDisassembler.cpp | |
parent | 0d886401b3ec09b0c2d267942b07702a2f0740f4 (diff) |
Add initial support for decoding NEON instructions in Thumb2 mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137236 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/Disassembler/ARMDisassembler.cpp')
-rw-r--r-- | lib/Target/ARM/Disassembler/ARMDisassembler.cpp | 54 |
1 files changed, 52 insertions, 2 deletions
diff --git a/lib/Target/ARM/Disassembler/ARMDisassembler.cpp b/lib/Target/ARM/Disassembler/ARMDisassembler.cpp index c9684e1f81..b6bfece1b5 100644 --- a/lib/Target/ARM/Disassembler/ARMDisassembler.cpp +++ b/lib/Target/ARM/Disassembler/ARMDisassembler.cpp @@ -249,12 +249,32 @@ bool ARMDisassembler::getInstruction(MCInst &MI, uint64_t &Size, } MI.clear(); - result = decodeNEONInstruction32(MI, insn, Address, this); + result = decodeNEONDataInstruction32(MI, insn, Address, this); if (result) { + Size = 4; // Add a fake predicate operand, because we share these instruction // definitions with Thumb2 where these instructions are predicable. if (!DecodePredicateOperand(MI, 0xE, Address, this)) return false; + return true; + } + + MI.clear(); + result = decodeNEONLoadStoreInstruction32(MI, insn, Address, this); + if (result) { Size = 4; + // Add a fake predicate operand, because we share these instruction + // definitions with Thumb2 where these instructions are predicable. + if (!DecodePredicateOperand(MI, 0xE, Address, this)) return false; + return true; + } + + MI.clear(); + result = decodeNEONDupInstruction32(MI, insn, Address, this); + if (result) { + Size = 4; + // Add a fake predicate operand, because we share these instruction + // definitions with Thumb2 where these instructions are predicable. + if (!DecodePredicateOperand(MI, 0xE, Address, this)) return false; return true; } @@ -434,6 +454,14 @@ bool ThumbDisassembler::getInstruction(MCInst &MI, uint64_t &Size, } MI.clear(); + result = decodeCommonInstruction32(MI, insn32, Address, this); + if (result) { + Size = 4; + AddThumbPredicate(MI); + return true; + } + + MI.clear(); result = decodeVFPInstruction32(MI, insn32, Address, this); if (result) { Size = 4; @@ -442,7 +470,29 @@ bool ThumbDisassembler::getInstruction(MCInst &MI, uint64_t &Size, } MI.clear(); - result = decodeCommonInstruction32(MI, insn32, Address, this); + if (fieldFromInstruction32(insn32, 24, 4) == 0xF) { + uint32_t NEONDataInsn = insn32; + NEONDataInsn &= 0xF0FFFFFF; // Clear bits 27-24 + NEONDataInsn |= (NEONDataInsn & 0x10000000) >> 4; // Move bit 28 to bit 24 + NEONDataInsn |= 0x12000000; // Set bits 28 and 25 + result = decodeNEONDataInstruction32(MI, NEONDataInsn, Address, this); + if (result) { + Size = 4; + AddThumbPredicate(MI); + return true; + } + } + + MI.clear(); + result = decodeNEONLoadStoreInstruction32(MI, insn32, Address, this); + if (result) { + Size = 4; + AddThumbPredicate(MI); + return true; + } + + MI.clear(); + result = decodeNEONDupInstruction32(MI, insn32, Address, this); if (result) { Size = 4; AddThumbPredicate(MI); |