35#define DEBUG_TYPE "arm-disassembler"
54 void advanceITState() {
59 bool instrInITBlock() {
60 return !ITStates.empty();
64 bool instrLastInITBlock() {
65 return ITStates.size() == 1;
72 void setITState(
char Firstcond,
char Mask) {
74 unsigned NumTZ = llvm::countr_zero<uint8_t>(Mask);
75 unsigned char CCBits =
static_cast<unsigned char>(Firstcond & 0xf);
76 assert(NumTZ <= 3 &&
"Invalid IT mask!");
78 for (
unsigned Pos = NumTZ+1; Pos <= 3; ++Pos) {
79 unsigned Else = (Mask >> Pos) & 1;
80 ITStates.push_back(CCBits ^ Else);
82 ITStates.push_back(CCBits);
86 std::vector<unsigned char> ITStates;
92 unsigned getVPTPred() {
94 if (instrInVPTBlock())
95 Pred = VPTStates.back();
99 void advanceVPTState() {
100 VPTStates.pop_back();
103 bool instrInVPTBlock() {
104 return !VPTStates.empty();
107 bool instrLastInVPTBlock() {
108 return VPTStates.size() == 1;
111 void setVPTState(
char Mask) {
113 unsigned NumTZ = llvm::countr_zero<uint8_t>(Mask);
114 assert(NumTZ <= 3 &&
"Invalid VPT mask!");
116 for (
unsigned Pos = NumTZ+1; Pos <= 3; ++Pos) {
117 bool T = ((Mask >> Pos) & 1) == 0;
133 std::unique_ptr<const MCInstrInfo> MCII;
138 InstructionEndianness = STI.
hasFeature(ARM::ModeBigEndianInstructions)
143 ~ARMDisassembler()
override =
default;
161 mutable ITStatus ITBlock;
162 mutable VPTStatus VPTBlock;
164 void AddThumb1SBit(
MCInst &
MI,
bool InITBlock)
const;
553template <
int shift,
int WriteBack>
615template <
bool isSigned,
bool isNeg,
bool zeroPermitted,
int size>
653template <
bool Writeback>
669template <
unsigned MinLog,
unsigned MaxLog>
673template <
unsigned start>
689template <
bool scalar, OperandDecoder predicate_decoder>
707#include "ARMGenDisassemblerTables.inc"
712 return new ARMDisassembler(STI, Ctx,
T.createMCInstrInfo());
720 switch (
MI.getOpcode()) {
739 if (
MI.getOperand(0).getReg() == ARM::SP &&
740 MI.getOperand(1).getReg() != ARM::SP)
743 default:
return Result;
752 if (!STI.hasFeature(ARM::ModeThumb))
767 if (Bytes.
size() < 2)
770 uint16_t Insn16 = llvm::support::endian::read<uint16_t>(
771 Bytes.
data(), InstructionEndianness);
772 return Insn16 < 0xE800 ? 2 : 4;
779 if (STI.hasFeature(ARM::ModeThumb))
780 return getThumbInstruction(
MI,
Size, Bytes, Address, CS);
781 return getARMInstruction(
MI,
Size, Bytes, Address, CS);
790 assert(!STI.hasFeature(ARM::ModeThumb) &&
791 "Asked to disassemble an ARM instruction but Subtarget is in Thumb "
795 if (Bytes.
size() < 4) {
802 InstructionEndianness);
806 decodeInstruction(DecoderTableARM32,
MI,
Insn, Address,
this, STI);
817 const DecodeTable Tables[] = {
818 {DecoderTableVFP32,
false}, {DecoderTableVFPV832,
false},
819 {DecoderTableNEONData32,
true}, {DecoderTableNEONLoadStore32,
true},
820 {DecoderTableNEONDup32,
true}, {DecoderTablev8NEON32,
false},
821 {DecoderTablev8Crypto32,
false},
824 for (
auto Table : Tables) {
825 Result = decodeInstruction(Table.P,
MI,
Insn, Address,
this, STI);
837 decodeInstruction(DecoderTableCoProc32,
MI,
Insn, Address,
this, STI);
888void ARMDisassembler::AddThumb1SBit(
MCInst &
MI,
bool InITBlock)
const {
892 if (
I ==
MI.end())
break;
893 if (MCID.
operands()[i].isOptionalDef() &&
894 MCID.
operands()[i].RegClass == ARM::CCRRegClassID) {
895 if (i > 0 && MCID.
operands()[i - 1].isPredicate())
905bool ARMDisassembler::isVectorPredicable(
const MCInst &
MI)
const {
919ARMDisassembler::AddThumbPredicate(
MCInst &
MI)
const {
922 const FeatureBitset &FeatureBits = getSubtargetInfo().getFeatureBits();
926 switch (
MI.getOpcode()) {
943 if (ITBlock.instrInITBlock())
949 if (
MI.getOperand(0).getImm() == 0x10 && (FeatureBits[ARM::FeatureRAS]) != 0)
958 if (ITBlock.instrInITBlock() && !ITBlock.instrLastInITBlock())
975 if (ITBlock.instrInITBlock()) {
976 CC = ITBlock.getITCC();
977 ITBlock.advanceITState();
978 }
else if (VPTBlock.instrInVPTBlock()) {
979 VCC = VPTBlock.getVPTPred();
980 VPTBlock.advanceVPTState();
986 for (
unsigned i = 0; i < MCID.
NumOperands; ++i, ++CCI) {
987 if (MCID.
operands()[i].isPredicate() || CCI ==
MI.end())
1004 for (VCCPos = 0; VCCPos < MCID.
NumOperands; ++VCCPos, ++VCCI) {
1022 "Inactive register in vpred_r is not tied to an output!");
1038void ARMDisassembler::UpdateThumbVFPPredicate(
1041 CC = ITBlock.getITCC();
1044 if (ITBlock.instrInITBlock())
1045 ITBlock.advanceITState();
1046 else if (VPTBlock.instrInVPTBlock()) {
1047 CC = VPTBlock.getVPTPred();
1048 VPTBlock.advanceVPTState();
1055 for (
unsigned i = 0; i < NumOps; ++i, ++
I) {
1056 if (OpInfo[i].isPredicate() ) {
1064 I->setReg(ARM::CPSR);
1074 CommentStream = &CS;
1076 assert(STI.hasFeature(ARM::ModeThumb) &&
1077 "Asked to disassemble in Thumb mode but Subtarget is in ARM mode!");
1080 if (Bytes.
size() < 2) {
1085 uint16_t Insn16 = llvm::support::endian::read<uint16_t>(
1086 Bytes.
data(), InstructionEndianness);
1088 decodeInstruction(DecoderTableThumb16,
MI, Insn16, Address,
this, STI);
1091 Check(Result, AddThumbPredicate(
MI));
1095 Result = decodeInstruction(DecoderTableThumbSBit16,
MI, Insn16, Address,
this,
1099 bool InITBlock = ITBlock.instrInITBlock();
1100 Check(Result, AddThumbPredicate(
MI));
1101 AddThumb1SBit(
MI, InITBlock);
1106 decodeInstruction(DecoderTableThumb216,
MI, Insn16, Address,
this, STI);
1112 if (
MI.getOpcode() == ARM::t2IT && ITBlock.instrInITBlock())
1115 Check(Result, AddThumbPredicate(
MI));
1120 if (
MI.getOpcode() == ARM::t2IT) {
1121 unsigned Firstcond =
MI.getOperand(0).getImm();
1122 unsigned Mask =
MI.getOperand(1).getImm();
1123 ITBlock.setITState(Firstcond, Mask);
1127 CS <<
"unpredictable IT predicate sequence";
1134 if (Bytes.
size() < 4) {
1140 (
uint32_t(Insn16) << 16) | llvm::support::endian::read<uint16_t>(
1141 Bytes.
data() + 2, InstructionEndianness);
1144 decodeInstruction(DecoderTableMVE32,
MI, Insn32, Address,
this, STI);
1150 if (
isVPTOpcode(
MI.getOpcode()) && VPTBlock.instrInVPTBlock())
1153 Check(Result, AddThumbPredicate(
MI));
1156 unsigned Mask =
MI.getOperand(0).getImm();
1157 VPTBlock.setVPTState(Mask);
1164 decodeInstruction(DecoderTableThumb32,
MI, Insn32, Address,
this, STI);
1167 bool InITBlock = ITBlock.instrInITBlock();
1168 Check(Result, AddThumbPredicate(
MI));
1169 AddThumb1SBit(
MI, InITBlock);
1174 decodeInstruction(DecoderTableThumb232,
MI, Insn32, Address,
this, STI);
1177 Check(Result, AddThumbPredicate(
MI));
1181 if (fieldFromInstruction(Insn32, 28, 4) == 0xE) {
1183 decodeInstruction(DecoderTableVFP32,
MI, Insn32, Address,
this, STI);
1186 UpdateThumbVFPPredicate(Result,
MI);
1192 decodeInstruction(DecoderTableVFPV832,
MI, Insn32, Address,
this, STI);
1198 if (fieldFromInstruction(Insn32, 28, 4) == 0xE) {
1199 Result = decodeInstruction(DecoderTableNEONDup32,
MI, Insn32, Address,
this,
1203 Check(Result, AddThumbPredicate(
MI));
1208 if (fieldFromInstruction(Insn32, 24, 8) == 0xF9) {
1210 NEONLdStInsn &= 0xF0FFFFFF;
1211 NEONLdStInsn |= 0x04000000;
1212 Result = decodeInstruction(DecoderTableNEONLoadStore32,
MI, NEONLdStInsn,
1213 Address,
this, STI);
1216 Check(Result, AddThumbPredicate(
MI));
1221 if (fieldFromInstruction(Insn32, 24, 4) == 0xF) {
1223 NEONDataInsn &= 0xF0FFFFFF;
1224 NEONDataInsn |= (NEONDataInsn & 0x10000000) >> 4;
1225 NEONDataInsn |= 0x12000000;
1226 Result = decodeInstruction(DecoderTableNEONData32,
MI, NEONDataInsn,
1227 Address,
this, STI);
1230 Check(Result, AddThumbPredicate(
MI));
1235 NEONCryptoInsn &= 0xF0FFFFFF;
1236 NEONCryptoInsn |= (NEONCryptoInsn & 0x10000000) >> 4;
1237 NEONCryptoInsn |= 0x12000000;
1238 Result = decodeInstruction(DecoderTablev8Crypto32,
MI, NEONCryptoInsn,
1239 Address,
this, STI);
1246 NEONv8Insn &= 0xF3FFFFFF;
1247 Result = decodeInstruction(DecoderTablev8NEON32,
MI, NEONv8Insn, Address,
1255 uint32_t Coproc = fieldFromInstruction(Insn32, 8, 4);
1257 ? DecoderTableThumb2CDE32
1258 : DecoderTableThumb2CoProc32;
1260 decodeInstruction(DecoderTable,
MI, Insn32, Address,
this, STI);
1263 Check(Result, AddThumbPredicate(
MI));
1283 ARM::R0, ARM::R1, ARM::R2, ARM::R3,
1284 ARM::R4, ARM::R5, ARM::R6, ARM::R7,
1285 ARM::R8, ARM::R9, ARM::R10, ARM::R11,
1286 ARM::R12, ARM::SP, ARM::LR, ARM::PC
1290 ARM::R0, ARM::R1, ARM::R2, ARM::R3,
1291 ARM::R4, ARM::R5, ARM::R6, ARM::R7,
1292 ARM::R8, ARM::R9, ARM::R10, ARM::R11,
1293 ARM::R12, 0, ARM::LR, ARM::APSR
1399 ARM::R0_R1, ARM::R2_R3, ARM::R4_R5, ARM::R6_R7,
1400 ARM::R8_R9, ARM::R10_R11, ARM::R12_SP
1430 if ((RegNo & 1) || RegNo > 10)
1483 ((
const MCDisassembler*)Decoder)->getSubtargetInfo().getFeatureBits();
1485 if ((RegNo == 13 && !featureBits[ARM::HasV8Ops]) || RegNo == 15)
1493 ARM::S0, ARM::S1, ARM::S2, ARM::S3,
1494 ARM::S4, ARM::S5, ARM::S6, ARM::S7,
1495 ARM::S8, ARM::S9, ARM::S10, ARM::S11,
1496 ARM::S12, ARM::S13, ARM::S14, ARM::S15,
1497 ARM::S16, ARM::S17, ARM::S18, ARM::S19,
1498 ARM::S20, ARM::S21, ARM::S22, ARM::S23,
1499 ARM::S24, ARM::S25, ARM::S26, ARM::S27,
1500 ARM::S28, ARM::S29, ARM::S30, ARM::S31
1521 ARM::D0, ARM::D1, ARM::D2, ARM::D3,
1522 ARM::D4, ARM::D5, ARM::D6, ARM::D7,
1523 ARM::D8, ARM::D9, ARM::D10, ARM::D11,
1524 ARM::D12, ARM::D13, ARM::D14, ARM::D15,
1525 ARM::D16, ARM::D17, ARM::D18, ARM::D19,
1526 ARM::D20, ARM::D21, ARM::D22, ARM::D23,
1527 ARM::D24, ARM::D25, ARM::D26, ARM::D27,
1528 ARM::D28, ARM::D29, ARM::D30, ARM::D31
1535 ((
const MCDisassembler*)Decoder)->getSubtargetInfo().getFeatureBits();
1537 bool hasD32 = featureBits[ARM::FeatureD32];
1539 if (RegNo > 31 || (!hasD32 && RegNo > 15))
1572 ARM::Q0, ARM::Q1, ARM::Q2, ARM::Q3,
1573 ARM::Q4, ARM::Q5, ARM::Q6, ARM::Q7,
1574 ARM::Q8, ARM::Q9, ARM::Q10, ARM::Q11,
1575 ARM::Q12, ARM::Q13, ARM::Q14, ARM::Q15
1581 if (RegNo > 31 || (RegNo & 1) != 0)
1591 ARM::Q0, ARM::D1_D2, ARM::Q1, ARM::D3_D4, ARM::Q2, ARM::D5_D6,
1592 ARM::Q3, ARM::D7_D8, ARM::Q4, ARM::D9_D10, ARM::Q5, ARM::D11_D12,
1593 ARM::Q6, ARM::D13_D14, ARM::Q7, ARM::D15_D16, ARM::Q8, ARM::D17_D18,
1594 ARM::Q9, ARM::D19_D20, ARM::Q10, ARM::D21_D22, ARM::Q11, ARM::D23_D24,
1595 ARM::Q12, ARM::D25_D26, ARM::Q13, ARM::D27_D28, ARM::Q14, ARM::D29_D30,
1611 ARM::D0_D2, ARM::D1_D3, ARM::D2_D4, ARM::D3_D5,
1612 ARM::D4_D6, ARM::D5_D7, ARM::D6_D8, ARM::D7_D9,
1613 ARM::D8_D10, ARM::D9_D11, ARM::D10_D12, ARM::D11_D13,
1614 ARM::D12_D14, ARM::D13_D15, ARM::D14_D16, ARM::D15_D17,
1615 ARM::D16_D18, ARM::D17_D19, ARM::D18_D20, ARM::D19_D21,
1616 ARM::D20_D22, ARM::D21_D23, ARM::D22_D24, ARM::D23_D25,
1617 ARM::D24_D26, ARM::D25_D27, ARM::D26_D28, ARM::D27_D29,
1618 ARM::D28_D30, ARM::D29_D31
1638 if (Inst.
getOpcode() == ARM::tBcc && Val == 0xE)
1641 static_cast<const ARMDisassembler *
>(Decoder)->MCII.
get();
1667 unsigned Rm = fieldFromInstruction(Val, 0, 4);
1668 unsigned type = fieldFromInstruction(Val, 5, 2);
1669 unsigned imm = fieldFromInstruction(Val, 7, 5);
1694 unsigned Op = Shift | (imm << 3);
1705 unsigned Rm = fieldFromInstruction(Val, 0, 4);
1706 unsigned type = fieldFromInstruction(Val, 5, 2);
1707 unsigned Rs = fieldFromInstruction(Val, 8, 4);
1741 bool NeedDisjointWriteback =
false;
1742 unsigned WritebackReg = 0;
1747 case ARM::LDMIA_UPD:
1748 case ARM::LDMDB_UPD:
1749 case ARM::LDMIB_UPD:
1750 case ARM::LDMDA_UPD:
1751 case ARM::t2LDMIA_UPD:
1752 case ARM::t2LDMDB_UPD:
1753 case ARM::t2STMIA_UPD:
1754 case ARM::t2STMDB_UPD:
1755 NeedDisjointWriteback =
true;
1765 for (
unsigned i = 0; i < 16; ++i) {
1766 if (Val & (1 << i)) {
1775 if (NeedDisjointWriteback && WritebackReg == Inst.
end()[-1].getReg())
1789 unsigned Vd = fieldFromInstruction(Val, 8, 5);
1790 unsigned regs = fieldFromInstruction(Val, 0, 8);
1793 if (regs == 0 || (Vd + regs) > 32) {
1794 regs = Vd + regs > 32 ? 32 - Vd : regs;
1795 regs = std::max( 1u, regs);
1801 for (
unsigned i = 0; i < (regs - 1); ++i) {
1814 unsigned Vd = fieldFromInstruction(Val, 8, 5);
1815 unsigned regs = fieldFromInstruction(Val, 1, 7);
1818 if (regs == 0 || regs > 16 || (Vd + regs) > 32) {
1819 regs = Vd + regs > 32 ? 32 - Vd : regs;
1820 regs = std::max( 1u, regs);
1821 regs = std::min(16u, regs);
1827 for (
unsigned i = 0; i < (regs - 1); ++i) {
1843 unsigned msb = fieldFromInstruction(Val, 5, 5);
1844 unsigned lsb = fieldFromInstruction(Val, 0, 5);
1856 if (msb != 31) msb_mask = (1U << (msb+1)) - 1;
1857 uint32_t lsb_mask = (1U << lsb) - 1;
1868 unsigned pred = fieldFromInstruction(
Insn, 28, 4);
1869 unsigned CRd = fieldFromInstruction(
Insn, 12, 4);
1870 unsigned coproc = fieldFromInstruction(
Insn, 8, 4);
1871 unsigned imm = fieldFromInstruction(
Insn, 0, 8);
1872 unsigned Rn = fieldFromInstruction(
Insn, 16, 4);
1873 unsigned U = fieldFromInstruction(
Insn, 23, 1);
1875 ((
const MCDisassembler*)Decoder)->getSubtargetInfo().getFeatureBits();
1878 case ARM::LDC_OFFSET:
1881 case ARM::LDC_OPTION:
1882 case ARM::LDCL_OFFSET:
1884 case ARM::LDCL_POST:
1885 case ARM::LDCL_OPTION:
1886 case ARM::STC_OFFSET:
1889 case ARM::STC_OPTION:
1890 case ARM::STCL_OFFSET:
1892 case ARM::STCL_POST:
1893 case ARM::STCL_OPTION:
1894 case ARM::t2LDC_OFFSET:
1895 case ARM::t2LDC_PRE:
1896 case ARM::t2LDC_POST:
1897 case ARM::t2LDC_OPTION:
1898 case ARM::t2LDCL_OFFSET:
1899 case ARM::t2LDCL_PRE:
1900 case ARM::t2LDCL_POST:
1901 case ARM::t2LDCL_OPTION:
1902 case ARM::t2STC_OFFSET:
1903 case ARM::t2STC_PRE:
1904 case ARM::t2STC_POST:
1905 case ARM::t2STC_OPTION:
1906 case ARM::t2STCL_OFFSET:
1907 case ARM::t2STCL_PRE:
1908 case ARM::t2STCL_POST:
1909 case ARM::t2STCL_OPTION:
1910 case ARM::t2LDC2_OFFSET:
1911 case ARM::t2LDC2L_OFFSET:
1912 case ARM::t2LDC2_PRE:
1913 case ARM::t2LDC2L_PRE:
1914 case ARM::t2STC2_OFFSET:
1915 case ARM::t2STC2L_OFFSET:
1916 case ARM::t2STC2_PRE:
1917 case ARM::t2STC2L_PRE:
1918 case ARM::LDC2_OFFSET:
1919 case ARM::LDC2L_OFFSET:
1921 case ARM::LDC2L_PRE:
1922 case ARM::STC2_OFFSET:
1923 case ARM::STC2L_OFFSET:
1925 case ARM::STC2L_PRE:
1926 case ARM::t2LDC2_OPTION:
1927 case ARM::t2STC2_OPTION:
1928 case ARM::t2LDC2_POST:
1929 case ARM::t2LDC2L_POST:
1930 case ARM::t2STC2_POST:
1931 case ARM::t2STC2L_POST:
1932 case ARM::LDC2_POST:
1933 case ARM::LDC2L_POST:
1934 case ARM::STC2_POST:
1935 case ARM::STC2L_POST:
1936 if (coproc == 0xA || coproc == 0xB ||
1937 (featureBits[ARM::HasV8_1MMainlineOps] &&
1938 (coproc == 0x8 || coproc == 0x9 || coproc == 0xA || coproc == 0xB ||
1939 coproc == 0xE || coproc == 0xF)))
1946 if (featureBits[ARM::HasV8Ops] && (coproc != 14))
1955 case ARM::t2LDC2_OFFSET:
1956 case ARM::t2LDC2L_OFFSET:
1957 case ARM::t2LDC2_PRE:
1958 case ARM::t2LDC2L_PRE:
1959 case ARM::t2STC2_OFFSET:
1960 case ARM::t2STC2L_OFFSET:
1961 case ARM::t2STC2_PRE:
1962 case ARM::t2STC2L_PRE:
1963 case ARM::LDC2_OFFSET:
1964 case ARM::LDC2L_OFFSET:
1966 case ARM::LDC2L_PRE:
1967 case ARM::STC2_OFFSET:
1968 case ARM::STC2L_OFFSET:
1970 case ARM::STC2L_PRE:
1971 case ARM::t2LDC_OFFSET:
1972 case ARM::t2LDCL_OFFSET:
1973 case ARM::t2LDC_PRE:
1974 case ARM::t2LDCL_PRE:
1975 case ARM::t2STC_OFFSET:
1976 case ARM::t2STCL_OFFSET:
1977 case ARM::t2STC_PRE:
1978 case ARM::t2STCL_PRE:
1979 case ARM::LDC_OFFSET:
1980 case ARM::LDCL_OFFSET:
1983 case ARM::STC_OFFSET:
1984 case ARM::STCL_OFFSET:
1990 case ARM::t2LDC2_POST:
1991 case ARM::t2LDC2L_POST:
1992 case ARM::t2STC2_POST:
1993 case ARM::t2STC2L_POST:
1994 case ARM::LDC2_POST:
1995 case ARM::LDC2L_POST:
1996 case ARM::STC2_POST:
1997 case ARM::STC2L_POST:
1998 case ARM::t2LDC_POST:
1999 case ARM::t2LDCL_POST:
2000 case ARM::t2STC_POST:
2001 case ARM::t2STCL_POST:
2003 case ARM::LDCL_POST:
2005 case ARM::STCL_POST:
2016 case ARM::LDC_OFFSET:
2019 case ARM::LDC_OPTION:
2020 case ARM::LDCL_OFFSET:
2022 case ARM::LDCL_POST:
2023 case ARM::LDCL_OPTION:
2024 case ARM::STC_OFFSET:
2027 case ARM::STC_OPTION:
2028 case ARM::STCL_OFFSET:
2030 case ARM::STCL_POST:
2031 case ARM::STCL_OPTION:
2047 unsigned Rn = fieldFromInstruction(
Insn, 16, 4);
2048 unsigned Rt = fieldFromInstruction(
Insn, 12, 4);
2049 unsigned Rm = fieldFromInstruction(
Insn, 0, 4);
2050 unsigned imm = fieldFromInstruction(
Insn, 0, 12);
2051 unsigned pred = fieldFromInstruction(
Insn, 28, 4);
2052 unsigned reg = fieldFromInstruction(
Insn, 25, 1);
2053 unsigned P = fieldFromInstruction(
Insn, 24, 1);
2054 unsigned W = fieldFromInstruction(
Insn, 21, 1);
2058 case ARM::STR_POST_IMM:
2059 case ARM::STR_POST_REG:
2060 case ARM::STRB_POST_IMM:
2061 case ARM::STRB_POST_REG:
2062 case ARM::STRT_POST_REG:
2063 case ARM::STRT_POST_IMM:
2064 case ARM::STRBT_POST_REG:
2065 case ARM::STRBT_POST_IMM:
2078 case ARM::LDR_POST_IMM:
2079 case ARM::LDR_POST_REG:
2080 case ARM::LDRB_POST_IMM:
2081 case ARM::LDRB_POST_REG:
2082 case ARM::LDRBT_POST_REG:
2083 case ARM::LDRBT_POST_IMM:
2084 case ARM::LDRT_POST_REG:
2085 case ARM::LDRT_POST_IMM:
2097 if (!fieldFromInstruction(
Insn, 23, 1))
2100 bool writeback = (
P == 0) || (W == 1);
2101 unsigned idx_mode = 0;
2104 else if (!
P && writeback)
2107 if (writeback && (Rn == 15 || Rn == Rt))
2114 switch( fieldFromInstruction(
Insn, 5, 2)) {
2130 unsigned amt = fieldFromInstruction(
Insn, 7, 5);
2153 unsigned Rn = fieldFromInstruction(Val, 13, 4);
2154 unsigned Rm = fieldFromInstruction(Val, 0, 4);
2155 unsigned type = fieldFromInstruction(Val, 5, 2);
2156 unsigned imm = fieldFromInstruction(Val, 7, 5);
2157 unsigned U = fieldFromInstruction(Val, 12, 1);
2210 unsigned Rt = fieldFromInstruction(
Insn, 12, 4);
2211 unsigned Rn = fieldFromInstruction(
Insn, 16, 4);
2212 unsigned Rm = fieldFromInstruction(
Insn, 0, 4);
2213 unsigned type = fieldFromInstruction(
Insn, 22, 1);
2214 unsigned imm = fieldFromInstruction(
Insn, 8, 4);
2215 unsigned U = ((~fieldFromInstruction(
Insn, 23, 1)) & 1) << 8;
2216 unsigned pred = fieldFromInstruction(
Insn, 28, 4);
2217 unsigned W = fieldFromInstruction(
Insn, 21, 1);
2218 unsigned P = fieldFromInstruction(
Insn, 24, 1);
2219 unsigned Rt2 = Rt + 1;
2221 bool writeback = (W == 1) | (
P == 0);
2227 case ARM::STRD_POST:
2230 case ARM::LDRD_POST:
2239 case ARM::STRD_POST:
2240 if (
P == 0 && W == 1)
2243 if (writeback && (Rn == 15 || Rn == Rt || Rn == Rt2))
2245 if (type && Rm == 15)
2249 if (!type && fieldFromInstruction(
Insn, 8, 4))
2254 case ARM::STRH_POST:
2257 if (writeback && (Rn == 15 || Rn == Rt))
2259 if (!type && Rm == 15)
2264 case ARM::LDRD_POST:
2265 if (type && Rn == 15) {
2270 if (
P == 0 && W == 1)
2272 if (!type && (Rt2 == 15 || Rm == 15 || Rm == Rt || Rm == Rt2))
2274 if (!type && writeback && Rn == 15)
2276 if (writeback && (Rn == Rt || Rn == Rt2))
2281 case ARM::LDRH_POST:
2282 if (type && Rn == 15) {
2289 if (!type && Rm == 15)
2291 if (!type && writeback && (Rn == 15 || Rn == Rt))
2295 case ARM::LDRSH_PRE:
2296 case ARM::LDRSH_POST:
2298 case ARM::LDRSB_PRE:
2299 case ARM::LDRSB_POST:
2300 if (type && Rn == 15) {
2305 if (type && (Rt == 15 || (writeback && Rn == Rt)))
2307 if (!type && (Rt == 15 || Rm == 15))
2309 if (!type && writeback && (Rn == 15 || Rn == Rt))
2326 case ARM::STRD_POST:
2329 case ARM::STRH_POST:
2343 case ARM::STRD_POST:
2346 case ARM::LDRD_POST:
2359 case ARM::LDRD_POST:
2362 case ARM::LDRH_POST:
2364 case ARM::LDRSH_PRE:
2365 case ARM::LDRSH_POST:
2367 case ARM::LDRSB_PRE:
2368 case ARM::LDRSB_POST:
2402 unsigned Rn = fieldFromInstruction(
Insn, 16, 4);
2403 unsigned mode = fieldFromInstruction(
Insn, 23, 2);
2432 unsigned Rd = fieldFromInstruction(
Insn, 12, 4);
2433 unsigned Rm = fieldFromInstruction(
Insn, 0, 4);
2434 unsigned Rn = fieldFromInstruction(
Insn, 16, 4);
2435 unsigned pred = fieldFromInstruction(
Insn, 28, 4);
2457 unsigned Rn = fieldFromInstruction(
Insn, 16, 4);
2458 unsigned pred = fieldFromInstruction(
Insn, 28, 4);
2459 unsigned reglist = fieldFromInstruction(
Insn, 0, 16);
2467 case ARM::LDMDA_UPD:
2473 case ARM::LDMDB_UPD:
2479 case ARM::LDMIA_UPD:
2485 case ARM::LDMIB_UPD:
2491 case ARM::STMDA_UPD:
2497 case ARM::STMDB_UPD:
2503 case ARM::STMIA_UPD:
2509 case ARM::STMIB_UPD:
2517 if (fieldFromInstruction(
Insn, 20, 1) == 0) {
2519 if (!(fieldFromInstruction(
Insn, 22, 1) == 1 &&
2520 fieldFromInstruction(
Insn, 20, 1) == 0))
2547 unsigned pred = fieldFromInstruction(
Insn, 28, 4);
2548 unsigned imm8 = fieldFromInstruction(
Insn, 0, 8);
2561 if (imm8 == 0x10 &&
pred != 0xe && ((FeatureBits[ARM::FeatureRAS]) != 0))
2570 unsigned imod = fieldFromInstruction(
Insn, 18, 2);
2571 unsigned M = fieldFromInstruction(
Insn, 17, 1);
2572 unsigned iflags = fieldFromInstruction(
Insn, 6, 3);
2573 unsigned mode = fieldFromInstruction(
Insn, 0, 5);
2579 if (fieldFromInstruction(
Insn, 5, 1) != 0 ||
2580 fieldFromInstruction(
Insn, 16, 1) != 0 ||
2581 fieldFromInstruction(
Insn, 20, 8) != 0x10)
2596 }
else if (imod && !M) {
2601 }
else if (!imod && M) {
2618 unsigned imod = fieldFromInstruction(
Insn, 9, 2);
2619 unsigned M = fieldFromInstruction(
Insn, 8, 1);
2620 unsigned iflags = fieldFromInstruction(
Insn, 5, 3);
2621 unsigned mode = fieldFromInstruction(
Insn, 0, 5);
2637 }
else if (imod && !M) {
2642 }
else if (!imod && M) {
2648 int imm = fieldFromInstruction(
Insn, 0, 8);
2661 unsigned imm = fieldFromInstruction(
Insn, 0, 8);
2663 unsigned Opcode = ARM::t2HINT;
2666 Opcode = ARM::t2PACBTI;
2667 }
else if (imm == 0x1D) {
2668 Opcode = ARM::t2PAC;
2669 }
else if (imm == 0x2D) {
2670 Opcode = ARM::t2AUT;
2671 }
else if (imm == 0x0F) {
2672 Opcode = ARM::t2BTI;
2676 if (Opcode == ARM::t2HINT) {
2688 unsigned Rd = fieldFromInstruction(
Insn, 8, 4);
2691 imm |= (fieldFromInstruction(
Insn, 0, 8) << 0);
2692 imm |= (fieldFromInstruction(
Insn, 12, 3) << 8);
2693 imm |= (fieldFromInstruction(
Insn, 16, 4) << 12);
2694 imm |= (fieldFromInstruction(
Insn, 26, 1) << 11);
2713 unsigned Rd = fieldFromInstruction(
Insn, 12, 4);
2714 unsigned pred = fieldFromInstruction(
Insn, 28, 4);
2717 imm |= (fieldFromInstruction(
Insn, 0, 12) << 0);
2718 imm |= (fieldFromInstruction(
Insn, 16, 4) << 12);
2741 unsigned Rd = fieldFromInstruction(
Insn, 16, 4);
2742 unsigned Rn = fieldFromInstruction(
Insn, 0, 4);
2743 unsigned Rm = fieldFromInstruction(
Insn, 8, 4);
2744 unsigned Ra = fieldFromInstruction(
Insn, 12, 4);
2745 unsigned pred = fieldFromInstruction(
Insn, 28, 4);
2770 unsigned Pred = fieldFromInstruction(
Insn, 28, 4);
2771 unsigned Rn = fieldFromInstruction(
Insn, 16, 4);
2772 unsigned Rm = fieldFromInstruction(
Insn, 0, 4);
2792 unsigned Imm = fieldFromInstruction(
Insn, 9, 1);
2797 if (!FeatureBits[ARM::HasV8_1aOps] ||
2798 !FeatureBits[ARM::HasV8Ops])
2803 if (fieldFromInstruction(
Insn, 20,12) != 0xf11 ||
2804 fieldFromInstruction(
Insn, 4,4) != 0)
2806 if (fieldFromInstruction(
Insn, 10,10) != 0 ||
2807 fieldFromInstruction(
Insn, 0,4) != 0)
2821 unsigned add = fieldFromInstruction(Val, 12, 1);
2822 unsigned imm = fieldFromInstruction(Val, 0, 12);
2823 unsigned Rn = fieldFromInstruction(Val, 13, 4);
2828 if (!add) imm *= -1;
2829 if (imm == 0 && !add) imm = INT32_MIN;
2842 unsigned Rn = fieldFromInstruction(Val, 9, 4);
2844 unsigned U = fieldFromInstruction(Val, 8, 1);
2845 unsigned imm = fieldFromInstruction(Val, 0, 8);
2863 unsigned Rn = fieldFromInstruction(Val, 9, 4);
2865 unsigned U = fieldFromInstruction(Val, 8, 1);
2866 unsigned imm = fieldFromInstruction(Val, 0, 8);
2896 unsigned S = fieldFromInstruction(
Insn, 26, 1);
2897 unsigned J1 = fieldFromInstruction(
Insn, 13, 1);
2898 unsigned J2 = fieldFromInstruction(
Insn, 11, 1);
2899 unsigned I1 = !(J1 ^ S);
2900 unsigned I2 = !(J2 ^ S);
2901 unsigned imm10 = fieldFromInstruction(
Insn, 16, 10);
2902 unsigned imm11 = fieldFromInstruction(
Insn, 0, 11);
2903 unsigned tmp = (S << 23) | (I1 << 22) | (I2 << 21) | (imm10 << 11) | imm11;
2904 int imm32 = SignExtend32<25>(tmp << 1);
2906 true, 4, Inst, Decoder))
2917 unsigned pred = fieldFromInstruction(
Insn, 28, 4);
2918 unsigned imm = fieldFromInstruction(
Insn, 0, 24) << 2;
2922 imm |= fieldFromInstruction(
Insn, 24, 1) << 1;
2924 true, 4, Inst, Decoder))
2930 true, 4, Inst, Decoder))
2947 unsigned Rm = fieldFromInstruction(Val, 0, 4);
2948 unsigned align = fieldFromInstruction(Val, 4, 2);
2965 unsigned Rd = fieldFromInstruction(
Insn, 12, 4);
2966 Rd |= fieldFromInstruction(
Insn, 22, 1) << 4;
2967 unsigned wb = fieldFromInstruction(
Insn, 16, 4);
2968 unsigned Rn = fieldFromInstruction(
Insn, 16, 4);
2969 Rn |= fieldFromInstruction(
Insn, 4, 2) << 4;
2970 unsigned Rm = fieldFromInstruction(
Insn, 0, 4);
2974 case ARM::VLD1q16:
case ARM::VLD1q32:
case ARM::VLD1q64:
case ARM::VLD1q8:
2975 case ARM::VLD1q16wb_fixed:
case ARM::VLD1q16wb_register:
2976 case ARM::VLD1q32wb_fixed:
case ARM::VLD1q32wb_register:
2977 case ARM::VLD1q64wb_fixed:
case ARM::VLD1q64wb_register:
2978 case ARM::VLD1q8wb_fixed:
case ARM::VLD1q8wb_register:
2979 case ARM::VLD2d16:
case ARM::VLD2d32:
case ARM::VLD2d8:
2980 case ARM::VLD2d16wb_fixed:
case ARM::VLD2d16wb_register:
2981 case ARM::VLD2d32wb_fixed:
case ARM::VLD2d32wb_register:
2982 case ARM::VLD2d8wb_fixed:
case ARM::VLD2d8wb_register:
2989 case ARM::VLD2b16wb_fixed:
2990 case ARM::VLD2b16wb_register:
2991 case ARM::VLD2b32wb_fixed:
2992 case ARM::VLD2b32wb_register:
2993 case ARM::VLD2b8wb_fixed:
2994 case ARM::VLD2b8wb_register:
3008 case ARM::VLD3d8_UPD:
3009 case ARM::VLD3d16_UPD:
3010 case ARM::VLD3d32_UPD:
3014 case ARM::VLD4d8_UPD:
3015 case ARM::VLD4d16_UPD:
3016 case ARM::VLD4d32_UPD:
3023 case ARM::VLD3q8_UPD:
3024 case ARM::VLD3q16_UPD:
3025 case ARM::VLD3q32_UPD:
3029 case ARM::VLD4q8_UPD:
3030 case ARM::VLD4q16_UPD:
3031 case ARM::VLD4q32_UPD:
3044 case ARM::VLD3d8_UPD:
3045 case ARM::VLD3d16_UPD:
3046 case ARM::VLD3d32_UPD:
3050 case ARM::VLD4d8_UPD:
3051 case ARM::VLD4d16_UPD:
3052 case ARM::VLD4d32_UPD:
3059 case ARM::VLD3q8_UPD:
3060 case ARM::VLD3q16_UPD:
3061 case ARM::VLD3q32_UPD:
3065 case ARM::VLD4q8_UPD:
3066 case ARM::VLD4q16_UPD:
3067 case ARM::VLD4q32_UPD:
3080 case ARM::VLD4d8_UPD:
3081 case ARM::VLD4d16_UPD:
3082 case ARM::VLD4d32_UPD:
3089 case ARM::VLD4q8_UPD:
3090 case ARM::VLD4q16_UPD:
3091 case ARM::VLD4q32_UPD:
3101 case ARM::VLD1d8wb_fixed:
3102 case ARM::VLD1d16wb_fixed:
3103 case ARM::VLD1d32wb_fixed:
3104 case ARM::VLD1d64wb_fixed:
3105 case ARM::VLD1d8wb_register:
3106 case ARM::VLD1d16wb_register:
3107 case ARM::VLD1d32wb_register:
3108 case ARM::VLD1d64wb_register:
3109 case ARM::VLD1q8wb_fixed:
3110 case ARM::VLD1q16wb_fixed:
3111 case ARM::VLD1q32wb_fixed:
3112 case ARM::VLD1q64wb_fixed:
3113 case ARM::VLD1q8wb_register:
3114 case ARM::VLD1q16wb_register:
3115 case ARM::VLD1q32wb_register:
3116 case ARM::VLD1q64wb_register:
3117 case ARM::VLD1d8Twb_fixed:
3118 case ARM::VLD1d8Twb_register:
3119 case ARM::VLD1d16Twb_fixed:
3120 case ARM::VLD1d16Twb_register:
3121 case ARM::VLD1d32Twb_fixed:
3122 case ARM::VLD1d32Twb_register:
3123 case ARM::VLD1d64Twb_fixed:
3124 case ARM::VLD1d64Twb_register:
3125 case ARM::VLD1d8Qwb_fixed:
3126 case ARM::VLD1d8Qwb_register:
3127 case ARM::VLD1d16Qwb_fixed:
3128 case ARM::VLD1d16Qwb_register:
3129 case ARM::VLD1d32Qwb_fixed:
3130 case ARM::VLD1d32Qwb_register:
3131 case ARM::VLD1d64Qwb_fixed:
3132 case ARM::VLD1d64Qwb_register:
3133 case ARM::VLD2d8wb_fixed:
3134 case ARM::VLD2d16wb_fixed:
3135 case ARM::VLD2d32wb_fixed:
3136 case ARM::VLD2q8wb_fixed:
3137 case ARM::VLD2q16wb_fixed:
3138 case ARM::VLD2q32wb_fixed:
3139 case ARM::VLD2d8wb_register:
3140 case ARM::VLD2d16wb_register:
3141 case ARM::VLD2d32wb_register:
3142 case ARM::VLD2q8wb_register:
3143 case ARM::VLD2q16wb_register:
3144 case ARM::VLD2q32wb_register:
3145 case ARM::VLD2b8wb_fixed:
3146 case ARM::VLD2b16wb_fixed:
3147 case ARM::VLD2b32wb_fixed:
3148 case ARM::VLD2b8wb_register:
3149 case ARM::VLD2b16wb_register:
3150 case ARM::VLD2b32wb_register:
3153 case ARM::VLD3d8_UPD:
3154 case ARM::VLD3d16_UPD:
3155 case ARM::VLD3d32_UPD:
3156 case ARM::VLD3q8_UPD:
3157 case ARM::VLD3q16_UPD:
3158 case ARM::VLD3q32_UPD:
3159 case ARM::VLD4d8_UPD:
3160 case ARM::VLD4d16_UPD:
3161 case ARM::VLD4d32_UPD:
3162 case ARM::VLD4q8_UPD:
3163 case ARM::VLD4q16_UPD:
3164 case ARM::VLD4q32_UPD:
3191 case ARM::VLD1d8wb_fixed:
3192 case ARM::VLD1d16wb_fixed:
3193 case ARM::VLD1d32wb_fixed:
3194 case ARM::VLD1d64wb_fixed:
3195 case ARM::VLD1d8Twb_fixed:
3196 case ARM::VLD1d16Twb_fixed:
3197 case ARM::VLD1d32Twb_fixed:
3198 case ARM::VLD1d64Twb_fixed:
3199 case ARM::VLD1d8Qwb_fixed:
3200 case ARM::VLD1d16Qwb_fixed:
3201 case ARM::VLD1d32Qwb_fixed:
3202 case ARM::VLD1d64Qwb_fixed:
3203 case ARM::VLD1d8wb_register:
3204 case ARM::VLD1d16wb_register:
3205 case ARM::VLD1d32wb_register:
3206 case ARM::VLD1d64wb_register:
3207 case ARM::VLD1q8wb_fixed:
3208 case ARM::VLD1q16wb_fixed:
3209 case ARM::VLD1q32wb_fixed:
3210 case ARM::VLD1q64wb_fixed:
3211 case ARM::VLD1q8wb_register:
3212 case ARM::VLD1q16wb_register:
3213 case ARM::VLD1q32wb_register:
3214 case ARM::VLD1q64wb_register:
3218 if (Rm != 0xD && Rm != 0xF &&
3222 case ARM::VLD2d8wb_fixed:
3223 case ARM::VLD2d16wb_fixed:
3224 case ARM::VLD2d32wb_fixed:
3225 case ARM::VLD2b8wb_fixed:
3226 case ARM::VLD2b16wb_fixed:
3227 case ARM::VLD2b32wb_fixed:
3228 case ARM::VLD2q8wb_fixed:
3229 case ARM::VLD2q16wb_fixed:
3230 case ARM::VLD2q32wb_fixed:
3240 unsigned type = fieldFromInstruction(
Insn, 8, 4);
3241 unsigned align = fieldFromInstruction(
Insn, 4, 2);
3246 unsigned load = fieldFromInstruction(
Insn, 21, 1);
3254 unsigned size = fieldFromInstruction(
Insn, 6, 2);
3257 unsigned type = fieldFromInstruction(
Insn, 8, 4);
3258 unsigned align = fieldFromInstruction(
Insn, 4, 2);
3262 unsigned load = fieldFromInstruction(
Insn, 21, 1);
3270 unsigned size = fieldFromInstruction(
Insn, 6, 2);
3273 unsigned align = fieldFromInstruction(
Insn, 4, 2);
3276 unsigned load = fieldFromInstruction(
Insn, 21, 1);
3284 unsigned size = fieldFromInstruction(
Insn, 6, 2);
3287 unsigned load = fieldFromInstruction(
Insn, 21, 1);
3297 unsigned Rd = fieldFromInstruction(
Insn, 12, 4);
3298 Rd |= fieldFromInstruction(
Insn, 22, 1) << 4;
3299 unsigned wb = fieldFromInstruction(
Insn, 16, 4);
3300 unsigned Rn = fieldFromInstruction(
Insn, 16, 4);
3301 Rn |= fieldFromInstruction(
Insn, 4, 2) << 4;
3302 unsigned Rm = fieldFromInstruction(
Insn, 0, 4);
3306 case ARM::VST1d8wb_fixed:
3307 case ARM::VST1d16wb_fixed:
3308 case ARM::VST1d32wb_fixed:
3309 case ARM::VST1d64wb_fixed:
3310 case ARM::VST1d8wb_register:
3311 case ARM::VST1d16wb_register:
3312 case ARM::VST1d32wb_register:
3313 case ARM::VST1d64wb_register:
3314 case ARM::VST1q8wb_fixed:
3315 case ARM::VST1q16wb_fixed:
3316 case ARM::VST1q32wb_fixed:
3317 case ARM::VST1q64wb_fixed:
3318 case ARM::VST1q8wb_register:
3319 case ARM::VST1q16wb_register:
3320 case ARM::VST1q32wb_register:
3321 case ARM::VST1q64wb_register:
3322 case ARM::VST1d8Twb_fixed:
3323 case ARM::VST1d16Twb_fixed:
3324 case ARM::VST1d32Twb_fixed:
3325 case ARM::VST1d64Twb_fixed:
3326 case ARM::VST1d8Twb_register:
3327 case ARM::VST1d16Twb_register:
3328 case ARM::VST1d32Twb_register:
3329 case ARM::VST1d64Twb_register:
3330 case ARM::VST1d8Qwb_fixed:
3331 case ARM::VST1d16Qwb_fixed:
3332 case ARM::VST1d32Qwb_fixed:
3333 case ARM::VST1d64Qwb_fixed:
3334 case ARM::VST1d8Qwb_register:
3335 case ARM::VST1d16Qwb_register:
3336 case ARM::VST1d32Qwb_register:
3337 case ARM::VST1d64Qwb_register:
3338 case ARM::VST2d8wb_fixed:
3339 case ARM::VST2d16wb_fixed:
3340 case ARM::VST2d32wb_fixed:
3341 case ARM::VST2d8wb_register:
3342 case ARM::VST2d16wb_register:
3343 case ARM::VST2d32wb_register:
3344 case ARM::VST2q8wb_fixed:
3345 case ARM::VST2q16wb_fixed:
3346 case ARM::VST2q32wb_fixed:
3347 case ARM::VST2q8wb_register:
3348 case ARM::VST2q16wb_register:
3349 case ARM::VST2q32wb_register:
3350 case ARM::VST2b8wb_fixed:
3351 case ARM::VST2b16wb_fixed:
3352 case ARM::VST2b32wb_fixed:
3353 case ARM::VST2b8wb_register:
3354 case ARM::VST2b16wb_register:
3355 case ARM::VST2b32wb_register:
3360 case ARM::VST3d8_UPD:
3361 case ARM::VST3d16_UPD:
3362 case ARM::VST3d32_UPD:
3363 case ARM::VST3q8_UPD:
3364 case ARM::VST3q16_UPD:
3365 case ARM::VST3q32_UPD:
3366 case ARM::VST4d8_UPD:
3367 case ARM::VST4d16_UPD:
3368 case ARM::VST4d32_UPD:
3369 case ARM::VST4q8_UPD:
3370 case ARM::VST4q16_UPD:
3371 case ARM::VST4q32_UPD:
3388 else if (Rm != 0xF) {
3393 case ARM::VST1d8wb_fixed:
3394 case ARM::VST1d16wb_fixed:
3395 case ARM::VST1d32wb_fixed:
3396 case ARM::VST1d64wb_fixed:
3397 case ARM::VST1q8wb_fixed:
3398 case ARM::VST1q16wb_fixed:
3399 case ARM::VST1q32wb_fixed:
3400 case ARM::VST1q64wb_fixed:
3401 case ARM::VST1d8Twb_fixed:
3402 case ARM::VST1d16Twb_fixed:
3403 case ARM::VST1d32Twb_fixed:
3404 case ARM::VST1d64Twb_fixed:
3405 case ARM::VST1d8Qwb_fixed:
3406 case ARM::VST1d16Qwb_fixed:
3407 case ARM::VST1d32Qwb_fixed:
3408 case ARM::VST1d64Qwb_fixed:
3409 case ARM::VST2d8wb_fixed:
3410 case ARM::VST2d16wb_fixed:
3411 case ARM::VST2d32wb_fixed:
3412 case ARM::VST2q8wb_fixed:
3413 case ARM::VST2q16wb_fixed:
3414 case ARM::VST2q32wb_fixed:
3415 case ARM::VST2b8wb_fixed:
3416 case ARM::VST2b16wb_fixed:
3417 case ARM::VST2b32wb_fixed:
3427 case ARM::VST1q16wb_fixed:
3428 case ARM::VST1q16wb_register:
3429 case ARM::VST1q32wb_fixed:
3430 case ARM::VST1q32wb_register:
3431 case ARM::VST1q64wb_fixed:
3432 case ARM::VST1q64wb_register:
3433 case ARM::VST1q8wb_fixed:
3434 case ARM::VST1q8wb_register:
3438 case ARM::VST2d16wb_fixed:
3439 case ARM::VST2d16wb_register:
3440 case ARM::VST2d32wb_fixed:
3441 case ARM::VST2d32wb_register:
3442 case ARM::VST2d8wb_fixed:
3443 case ARM::VST2d8wb_register:
3450 case ARM::VST2b16wb_fixed:
3451 case ARM::VST2b16wb_register:
3452 case ARM::VST2b32wb_fixed:
3453 case ARM::VST2b32wb_register:
3454 case ARM::VST2b8wb_fixed:
3455 case ARM::VST2b8wb_register:
3469 case ARM::VST3d8_UPD:
3470 case ARM::VST3d16_UPD:
3471 case ARM::VST3d32_UPD:
3475 case ARM::VST4d8_UPD:
3476 case ARM::VST4d16_UPD:
3477 case ARM::VST4d32_UPD:
3484 case ARM::VST3q8_UPD:
3485 case ARM::VST3q16_UPD:
3486 case ARM::VST3q32_UPD:
3490 case ARM::VST4q8_UPD:
3491 case ARM::VST4q16_UPD:
3492 case ARM::VST4q32_UPD:
3505 case ARM::VST3d8_UPD:
3506 case ARM::VST3d16_UPD:
3507 case ARM::VST3d32_UPD:
3511 case ARM::VST4d8_UPD:
3512 case ARM::VST4d16_UPD:
3513 case ARM::VST4d32_UPD:
3520 case ARM::VST3q8_UPD:
3521 case ARM::VST3q16_UPD:
3522 case ARM::VST3q32_UPD:
3526 case ARM::VST4q8_UPD:
3527 case ARM::VST4q16_UPD:
3528 case ARM::VST4q32_UPD:
3541 case ARM::VST4d8_UPD:
3542 case ARM::VST4d16_UPD:
3543 case ARM::VST4d32_UPD:
3550 case ARM::VST4q8_UPD:
3551 case ARM::VST4q16_UPD:
3552 case ARM::VST4q32_UPD:
3568 unsigned Rd = fieldFromInstruction(
Insn, 12, 4);
3569 Rd |= fieldFromInstruction(
Insn, 22, 1) << 4;
3570 unsigned Rn = fieldFromInstruction(
Insn, 16, 4);
3571 unsigned Rm = fieldFromInstruction(
Insn, 0, 4);
3572 unsigned align = fieldFromInstruction(
Insn, 4, 1);
3573 unsigned size = fieldFromInstruction(
Insn, 6, 2);
3575 if (
size == 0 && align == 1)
3577 align *= (1 <<
size);
3580 case ARM::VLD1DUPq16:
case ARM::VLD1DUPq32:
case ARM::VLD1DUPq8:
3581 case ARM::VLD1DUPq16wb_fixed:
case ARM::VLD1DUPq16wb_register:
3582 case ARM::VLD1DUPq32wb_fixed:
case ARM::VLD1DUPq32wb_register:
3583 case ARM::VLD1DUPq8wb_fixed:
case ARM::VLD1DUPq8wb_register:
3604 if (Rm != 0xD && Rm != 0xF &&
3616 unsigned Rd = fieldFromInstruction(
Insn, 12, 4);
3617 Rd |= fieldFromInstruction(
Insn, 22, 1) << 4;
3618 unsigned Rn = fieldFromInstruction(
Insn, 16, 4);
3619 unsigned Rm = fieldFromInstruction(
Insn, 0, 4);
3620 unsigned align = fieldFromInstruction(
Insn, 4, 1);
3621 unsigned size = 1 << fieldFromInstruction(
Insn, 6, 2);
3625 case ARM::VLD2DUPd16:
case ARM::VLD2DUPd32:
case ARM::VLD2DUPd8:
3626 case ARM::VLD2DUPd16wb_fixed:
case ARM::VLD2DUPd16wb_register:
3627 case ARM::VLD2DUPd32wb_fixed:
case ARM::VLD2DUPd32wb_register:
3628 case ARM::VLD2DUPd8wb_fixed:
case ARM::VLD2DUPd8wb_register:
3632 case ARM::VLD2DUPd16x2:
case ARM::VLD2DUPd32x2:
case ARM::VLD2DUPd8x2:
3633 case ARM::VLD2DUPd16x2wb_fixed:
case ARM::VLD2DUPd16x2wb_register:
3634 case ARM::VLD2DUPd32x2wb_fixed:
case ARM::VLD2DUPd32x2wb_register:
3635 case ARM::VLD2DUPd8x2wb_fixed:
case ARM::VLD2DUPd8x2wb_register:
3652 if (Rm != 0xD && Rm != 0xF) {
3665 unsigned Rd = fieldFromInstruction(
Insn, 12, 4);
3666 Rd |= fieldFromInstruction(
Insn, 22, 1) << 4;
3667 unsigned Rn = fieldFromInstruction(
Insn, 16, 4);
3668 unsigned Rm = fieldFromInstruction(
Insn, 0, 4);
3669 unsigned inc = fieldFromInstruction(
Insn, 5, 1) + 1;
3688 else if (Rm != 0xF) {
3701 unsigned Rd = fieldFromInstruction(
Insn, 12, 4);
3702 Rd |= fieldFromInstruction(
Insn, 22, 1) << 4;
3703 unsigned Rn = fieldFromInstruction(
Insn, 16, 4);
3704 unsigned Rm = fieldFromInstruction(
Insn, 0, 4);
3705 unsigned size = fieldFromInstruction(
Insn, 6, 2);
3706 unsigned inc = fieldFromInstruction(
Insn, 5, 1) + 1;
3707 unsigned align = fieldFromInstruction(
Insn, 4, 1);
3741 else if (Rm != 0xF) {
3754 unsigned Rd = fieldFromInstruction(
Insn, 12, 4);
3755 Rd |= fieldFromInstruction(
Insn, 22, 1) << 4;
3756 unsigned imm = fieldFromInstruction(
Insn, 0, 4);
3757 imm |= fieldFromInstruction(
Insn, 16, 3) << 4;
3758 imm |= fieldFromInstruction(
Insn, 24, 1) << 7;
3759 imm |= fieldFromInstruction(
Insn, 8, 4) << 8;
3760 imm |= fieldFromInstruction(
Insn, 5, 1) << 12;
3761 unsigned Q = fieldFromInstruction(
Insn, 6, 1);
3774 case ARM::VORRiv4i16:
3775 case ARM::VORRiv2i32:
3776 case ARM::VBICiv4i16:
3777 case ARM::VBICiv2i32:
3781 case ARM::VORRiv8i16:
3782 case ARM::VORRiv4i32:
3783 case ARM::VBICiv8i16:
3784 case ARM::VBICiv4i32:
3800 unsigned Qd = ((fieldFromInstruction(
Insn, 22, 1) << 3) |
3801 fieldFromInstruction(
Insn, 13, 3));
3802 unsigned cmode = fieldFromInstruction(
Insn, 8, 4);
3803 unsigned imm = fieldFromInstruction(
Insn, 0, 4);
3804 imm |= fieldFromInstruction(
Insn, 16, 3) << 4;
3805 imm |= fieldFromInstruction(
Insn, 28, 1) << 7;
3807 imm |= fieldFromInstruction(
Insn, 5, 1) << 12;
3809 if (cmode == 0xF && Inst.
getOpcode() == ARM::MVE_VMVNimmi32)
3829 unsigned Qd = fieldFromInstruction(
Insn, 13, 3);
3830 Qd |= fieldFromInstruction(
Insn, 22, 1) << 3;
3835 unsigned Qn = fieldFromInstruction(
Insn, 17, 3);
3836 Qn |= fieldFromInstruction(
Insn, 7, 1) << 3;
3839 unsigned Qm = fieldFromInstruction(
Insn, 1, 3);
3840 Qm |= fieldFromInstruction(
Insn, 5, 1) << 3;
3843 if (!fieldFromInstruction(
Insn, 12, 1))
3855 unsigned Rd = fieldFromInstruction(
Insn, 12, 4);
3856 Rd |= fieldFromInstruction(
Insn, 22, 1) << 4;
3857 unsigned Rm = fieldFromInstruction(
Insn, 0, 4);
3858 Rm |= fieldFromInstruction(
Insn, 5, 1) << 4;
3859 unsigned size = fieldFromInstruction(
Insn, 18, 2);
3903 unsigned Rd = fieldFromInstruction(
Insn, 12, 4);
3904 Rd |= fieldFromInstruction(
Insn, 22, 1) << 4;
3905 unsigned Rn = fieldFromInstruction(
Insn, 16, 4);
3906 Rn |= fieldFromInstruction(
Insn, 7, 1) << 4;
3907 unsigned Rm = fieldFromInstruction(
Insn, 0, 4);
3908 Rm |= fieldFromInstruction(
Insn, 5, 1) << 4;
3909 unsigned op = fieldFromInstruction(
Insn, 6, 1);
3940 unsigned dst = fieldFromInstruction(
Insn, 8, 3);
3941 unsigned imm = fieldFromInstruction(
Insn, 0, 8);
3964 true, 2, Inst, Decoder))
3973 true, 4, Inst, Decoder))
3982 true, 2, Inst, Decoder))
3992 unsigned Rn = fieldFromInstruction(Val, 0, 3);
3993 unsigned Rm = fieldFromInstruction(Val, 3, 3);
4008 unsigned Rn = fieldFromInstruction(Val, 0, 3);
4009 unsigned imm = fieldFromInstruction(Val, 3, 5);
4021 unsigned imm = Val << 2;
4043 unsigned Rn = fieldFromInstruction(Val, 6, 4);
4044 unsigned Rm = fieldFromInstruction(Val, 2, 4);
4045 unsigned imm = fieldFromInstruction(Val, 0, 2);
4073 unsigned Rt = fieldFromInstruction(
Insn, 12, 4);
4074 unsigned Rn = fieldFromInstruction(
Insn, 16, 4);
4077 ((
const MCDisassembler*)Decoder)->getSubtargetInfo().getFeatureBits();
4079 bool hasMP = featureBits[ARM::FeatureMP];
4080 bool hasV7Ops = featureBits[ARM::HasV7Ops];
4135 if (!hasV7Ops || !hasMP)
4143 unsigned addrmode = fieldFromInstruction(
Insn, 4, 2);
4144 addrmode |= fieldFromInstruction(
Insn, 0, 4) << 2;
4145 addrmode |= fieldFromInstruction(
Insn, 16, 4) << 6;
4157 unsigned Rn = fieldFromInstruction(
Insn, 16, 4);
4158 unsigned Rt = fieldFromInstruction(
Insn, 12, 4);
4159 unsigned U = fieldFromInstruction(
Insn, 9, 1);
4160 unsigned imm = fieldFromInstruction(
Insn, 0, 8);
4163 unsigned add = fieldFromInstruction(
Insn, 9, 1);
4166 ((
const MCDisassembler*)Decoder)->getSubtargetInfo().getFeatureBits();
4168 bool hasMP = featureBits[ARM::FeatureMP];
4169 bool hasV7Ops = featureBits[ARM::HasV7Ops];
4179 case ARM::t2LDRSBi8:
4185 case ARM::t2LDRSHi8:
4202 case ARM::t2LDRSHi8:
4208 case ARM::t2LDRSBi8:
4224 if (!hasV7Ops || !hasMP)
4242 unsigned Rn = fieldFromInstruction(
Insn, 16, 4);
4243 unsigned Rt = fieldFromInstruction(
Insn, 12, 4);
4244 unsigned imm = fieldFromInstruction(
Insn, 0, 12);
4248 ((
const MCDisassembler*)Decoder)->getSubtargetInfo().getFeatureBits();
4250 bool hasMP = featureBits[ARM::FeatureMP];
4251 bool hasV7Ops = featureBits[ARM::HasV7Ops];
4258 case ARM::t2LDRHi12:
4261 case ARM::t2LDRSHi12:
4264 case ARM::t2LDRBi12:
4267 case ARM::t2LDRSBi12:
4284 case ARM::t2LDRSHi12:
4286 case ARM::t2LDRHi12:
4289 case ARM::t2LDRSBi12:
4304 case ARM::t2PLDWi12:
4305 if (!hasV7Ops || !hasMP)
4322 unsigned Rn = fieldFromInstruction(
Insn, 16, 4);
4323 unsigned Rt = fieldFromInstruction(
Insn, 12, 4);
4324 unsigned imm = fieldFromInstruction(
Insn, 0, 8);
4362 unsigned Rt = fieldFromInstruction(
Insn, 12, 4);
4363 unsigned U = fieldFromInstruction(
Insn, 23, 1);
4364 int imm = fieldFromInstruction(
Insn, 0, 12);
4367 ((
const MCDisassembler*)Decoder)->getSubtargetInfo().getFeatureBits();
4369 bool hasV7Ops = featureBits[ARM::HasV7Ops];
4373 case ARM::t2LDRBpci:
4374 case ARM::t2LDRHpci:
4377 case ARM::t2LDRSBpci:
4380 case ARM::t2LDRSHpci:
4416 int imm = Val & 0xFF;
4418 if (!(Val & 0x100)) imm *= -1;
4430 int imm = Val & 0x7F;
4445 unsigned Rn = fieldFromInstruction(Val, 9, 4);
4446 unsigned imm = fieldFromInstruction(Val, 0, 9);
4461 unsigned Rn = fieldFromInstruction(Val, 8, 4);
4462 unsigned imm = fieldFromInstruction(Val, 0, 8);
4477 unsigned Rn = fieldFromInstruction(Val, 8, 4);
4478 unsigned imm = fieldFromInstruction(Val, 0, 8);
4490 int imm = Val & 0xFF;
4493 else if (!(Val & 0x100))
4503 int imm = Val & 0x7F;
4506 else if (!(Val & 0x80))
4508 if (imm != INT32_MIN)
4509 imm *= (1U << shift);
4520 unsigned Rn = fieldFromInstruction(Val, 9, 4);
4521 unsigned imm = fieldFromInstruction(Val, 0, 9);
4568 unsigned Rn = fieldFromInstruction(Val, 8, 3);
4569 unsigned imm = fieldFromInstruction(Val, 0, 8);
4573 if (!
Check(S, DecodeT2Imm7<shift>(Inst, imm, Address, Decoder)))
4579template <
int shift,
int WriteBack>
4585 unsigned Rn = fieldFromInstruction(Val, 8, 4);
4586 unsigned imm = fieldFromInstruction(Val, 0, 8);
4592 if (!
Check(S, DecodeT2Imm7<shift>(Inst, imm, Address, Decoder)))
4603 unsigned Rt = fieldFromInstruction(
Insn, 12, 4);
4604 unsigned Rn = fieldFromInstruction(
Insn, 16, 4);
4605 unsigned addr = fieldFromInstruction(
Insn, 0, 8);
4606 addr |= fieldFromInstruction(
Insn, 9, 1) << 8;
4608 unsigned load = fieldFromInstruction(
Insn, 20, 1);
4612 case ARM::t2LDR_PRE:
4613 case ARM::t2LDR_POST:
4616 case ARM::t2LDRB_PRE:
4617 case ARM::t2LDRB_POST:
4620 case ARM::t2LDRH_PRE:
4621 case ARM::t2LDRH_POST:
4624 case ARM::t2LDRSB_PRE:
4625 case ARM::t2LDRSB_POST:
4631 case ARM::t2LDRSH_PRE:
4632 case ARM::t2LDRSH_POST: