diff options
author | Amaury de la Vieuville <amaury.dlv@gmail.com> | 2013-06-24 09:15:01 +0000 |
---|---|---|
committer | Amaury de la Vieuville <amaury.dlv@gmail.com> | 2013-06-24 09:15:01 +0000 |
commit | 8449c0d5ed1e1a9b723329e42873b96e935b4e7c (patch) | |
tree | 6fbd3a867252c4db98ecad12c044f3cfc8afe0c7 /llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp | |
parent | 8175bda3dbbadc3d5c831342dd817d62be926355 (diff) | |
download | bcm5719-llvm-8449c0d5ed1e1a9b723329e42873b96e935b4e7c.tar.gz bcm5719-llvm-8449c0d5ed1e1a9b723329e42873b96e935b4e7c.zip |
ARM: check predicate bits for thumb instructions
When encoded to thumb, VFP instruction and VMOV/VDUP between scalar and
core registers, must have their predicate bit to 0b1110.
llvm-svn: 184707
Diffstat (limited to 'llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp b/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp index 6aaf4c06b3c..31941c10ea4 100644 --- a/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp +++ b/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp @@ -754,21 +754,25 @@ DecodeStatus ThumbDisassembler::getInstruction(MCInst &MI, uint64_t &Size, return result; } - MI.clear(); - result = decodeInstruction(DecoderTableVFP32, MI, insn32, Address, this, STI); - if (result != MCDisassembler::Fail) { - Size = 4; - UpdateThumbVFPPredicate(MI); - return result; + if (fieldFromInstruction(insn32, 28, 4) == 0xE) { + MI.clear(); + result = decodeInstruction(DecoderTableVFP32, MI, insn32, Address, this, STI); + if (result != MCDisassembler::Fail) { + Size = 4; + UpdateThumbVFPPredicate(MI); + return result; + } } - MI.clear(); - result = decodeInstruction(DecoderTableNEONDup32, MI, insn32, Address, - this, STI); - if (result != MCDisassembler::Fail) { - Size = 4; - Check(result, AddThumbPredicate(MI)); - return result; + if (fieldFromInstruction(insn32, 28, 4) == 0xE) { + MI.clear(); + result = decodeInstruction(DecoderTableNEONDup32, MI, insn32, Address, + this, STI); + if (result != MCDisassembler::Fail) { + Size = 4; + Check(result, AddThumbPredicate(MI)); + return result; + } } if (fieldFromInstruction(insn32, 24, 8) == 0xF9) { |