aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-07-25 22:20:28 +0000
committerJim Grosbach <grosbach@apple.com>2011-07-25 22:20:28 +0000
commit580f4a9c1c2fcbb8877463f873c6e9ca2a5ccf9f (patch)
tree0ed0fe0dd26158e4863627ffffab2a73e240c594 /lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h
parent478849e98ca4661d77c1d6f3f96e8b28e1183fbd (diff)
downloadexternal_llvm-580f4a9c1c2fcbb8877463f873c6e9ca2a5ccf9f.tar.gz
external_llvm-580f4a9c1c2fcbb8877463f873c6e9ca2a5ccf9f.tar.bz2
external_llvm-580f4a9c1c2fcbb8877463f873c6e9ca2a5ccf9f.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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135990 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h')
-rw-r--r--lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h16
1 files changed, 5 insertions, 11 deletions
diff --git a/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h b/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h
index 7ad958f51a..694ffe6e99 100644
--- a/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h
+++ b/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;
}