diff options
author | Jim Grosbach <grosbach@apple.com> | 2011-07-25 22:20:28 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2011-07-25 22:20:28 +0000 |
commit | 3a9cbeed73722c6a99d56a866b51c967ab906ce0 (patch) | |
tree | 7a0540c94cd947ce1a5f61d6c21d76d1092d9cfc /llvm/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h | |
parent | 77d24d374a735aaa052c1674fd1b82f80c726a14 (diff) | |
download | bcm5719-llvm-3a9cbeed73722c6a99d56a866b51c967ab906ce0.tar.gz bcm5719-llvm-3a9cbeed73722c6a99d56a866b51c967ab906ce0.zip |
ARM assembly parsing and encoding for SSAT instruction.
Fix the Rn register encoding for both SSAT and USAT. Update the parsing of the
shift operand to correctly handle the allowed shift types and immediate ranges
and issue meaningful diagnostics when an illegal value or shift type is
specified. Add aliases to parse an ommitted shift operand (default value of
'lsl #0').
Add tests for diagnostics and proper encoding.
llvm-svn: 135990
Diffstat (limited to 'llvm/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h')
-rw-r--r-- | llvm/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/llvm/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h b/llvm/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h index 7ad958f51a7..694ffe6e991 100644 --- a/llvm/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h +++ b/llvm/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h @@ -1615,17 +1615,11 @@ static bool DisassembleThumb2Sat(MCInst &MI, unsigned Opcode, uint32_t insn, decodeRn(insn)))); if (NumOpsAdded == 4) { - ARM_AM::ShiftOpc Opc = (slice(insn, 21, 21) != 0 ? - ARM_AM::asr : ARM_AM::lsl); - // Inst{14-12:7-6} encodes the imm5 shift amount. - unsigned ShAmt = slice(insn, 14, 12) << 2 | slice(insn, 7, 6); - if (ShAmt == 0) { - if (Opc == ARM_AM::asr) - ShAmt = 32; - else - Opc = ARM_AM::no_shift; - } - MI.addOperand(MCOperand::CreateImm(ARM_AM::getSORegOpc(Opc, ShAmt))); + // Inst{6} encodes the shift type. + bool isASR = slice(insn, 6, 6); + // Inst{11-7} encodes the imm5 shift amount. + unsigned ShAmt = slice(insn, 11, 7); + MI.addOperand(MCOperand::CreateImm(isASR << 5 | ShAmt)); } return true; } |