37#define DEBUG_TYPE "arm-disassembler"
55 void advanceITState() { ITStates.pop_back(); }
58 bool instrInITBlock() {
return !ITStates.empty(); }
61 bool instrLastInITBlock() {
return ITStates.size() == 1; }
67 void setITState(
char Firstcond,
char Mask) {
69 unsigned NumTZ = llvm::countr_zero<uint8_t>(Mask);
70 unsigned char CCBits =
static_cast<unsigned char>(Firstcond & 0xf);
71 assert(NumTZ <= 3 &&
"Invalid IT mask!");
73 for (
unsigned Pos = NumTZ + 1; Pos <= 3; ++Pos) {
74 unsigned Else = (Mask >> Pos) & 1;
75 ITStates.push_back(CCBits ^ Else);
77 ITStates.push_back(CCBits);
81 std::vector<unsigned char> ITStates;
86 unsigned getVPTPred() {
88 if (instrInVPTBlock())
89 Pred = VPTStates.back();
93 void advanceVPTState() { VPTStates.pop_back(); }
95 bool instrInVPTBlock() {
return !VPTStates.empty(); }
97 bool instrLastInVPTBlock() {
return VPTStates.size() == 1; }
99 void setVPTState(
char Mask) {
101 unsigned NumTZ = llvm::countr_zero<uint8_t>(Mask);
102 assert(NumTZ <= 3 &&
"Invalid VPT mask!");
104 for (
unsigned Pos = NumTZ + 1; Pos <= 3; ++Pos) {
105 bool T = ((Mask >> Pos) & 1) == 0;
121 std::unique_ptr<const MCInstrInfo> MCII;
126 InstructionEndianness = STI.
hasFeature(ARM::ModeBigEndianInstructions)
131 ~ARMDisassembler()
override =
default;
149 mutable ITStatus ITBlock;
150 mutable VPTStatus VPTBlock;
152 void AddThumb1SBit(
MCInst &
MI,
bool InITBlock)
const;
541template <
int shift,
int WriteBack>
603template <
bool isSigned,
bool isNeg,
bool zeroPermitted,
int size>
641template <
bool Writeback>
657template <
unsigned MinLog,
unsigned MaxLog>
661template <
unsigned start>
677template <
bool scalar, OperandDecoder predicate_decoder>
731#include "ARMGenDisassemblerTables.inc"
736 return new ARMDisassembler(STI, Ctx,
T.createMCInstrInfo());
744 switch (
MI.getOpcode()) {
763 if (
MI.getOperand(0).getReg() == ARM::SP &&
764 MI.getOperand(1).getReg() != ARM::SP)
767 default:
return Result;
776 if (!STI.hasFeature(ARM::ModeThumb))
791 if (Bytes.
size() < 2)
794 uint16_t Insn16 = llvm::support::endian::read<uint16_t>(
795 Bytes.
data(), InstructionEndianness);
796 return Insn16 < 0xE800 ? 2 : 4;
803 if (STI.hasFeature(ARM::ModeThumb))
804 return getThumbInstruction(
MI,
Size, Bytes, Address, CS);
805 return getARMInstruction(
MI,
Size, Bytes, Address, CS);
814 assert(!STI.hasFeature(ARM::ModeThumb) &&
815 "Asked to disassemble an ARM instruction but Subtarget is in Thumb "
819 if (Bytes.
size() < 4) {
825 uint32_t Insn = llvm::support::endian::read<uint32_t>(Bytes.
data(),
826 InstructionEndianness);
830 decodeInstruction(DecoderTableARM32,
MI, Insn, Address,
this, STI);
841 const DecodeTable Tables[] = {
842 {DecoderTableVFP32,
false}, {DecoderTableVFPV832,
false},
843 {DecoderTableNEONData32,
true}, {DecoderTableNEONLoadStore32,
true},
844 {DecoderTableNEONDup32,
true}, {DecoderTablev8NEON32,
false},
845 {DecoderTablev8Crypto32,
false},
848 for (
auto Table : Tables) {
849 Result = decodeInstruction(Table.P,
MI, Insn, Address,
this, STI);
861 decodeInstruction(DecoderTableCoProc32,
MI, Insn, Address,
this, STI);
875void ARMDisassembler::AddThumb1SBit(
MCInst &
MI,
bool InITBlock)
const {
879 if (
I ==
MI.end())
break;
880 if (MCID.
operands()[i].isOptionalDef() &&
881 MCID.
operands()[i].RegClass == ARM::CCRRegClassID) {
882 if (i > 0 && MCID.
operands()[i - 1].isPredicate())
893bool ARMDisassembler::isVectorPredicable(
const MCInst &
MI)
const {
907ARMDisassembler::AddThumbPredicate(
MCInst &
MI)
const {
910 const FeatureBitset &FeatureBits = getSubtargetInfo().getFeatureBits();
914 switch (
MI.getOpcode()) {
931 if (ITBlock.instrInITBlock())
937 if (
MI.getOperand(0).getImm() == 0x10 && (FeatureBits[ARM::FeatureRAS]) != 0)
946 if (ITBlock.instrInITBlock() && !ITBlock.instrLastInITBlock())
963 if (ITBlock.instrInITBlock()) {
964 CC = ITBlock.getITCC();
965 ITBlock.advanceITState();
966 }
else if (VPTBlock.instrInVPTBlock()) {
967 VCC = VPTBlock.getVPTPred();
968 VPTBlock.advanceVPTState();
974 for (
unsigned i = 0; i < MCID.
NumOperands; ++i, ++CCI) {
975 if (MCID.
operands()[i].isPredicate() || CCI ==
MI.end())
992 for (VCCPos = 0; VCCPos < MCID.
NumOperands; ++VCCPos, ++VCCI) {
1010 "Inactive register in vpred_r is not tied to an output!");
1026void ARMDisassembler::UpdateThumbVFPPredicate(
1029 CC = ITBlock.getITCC();
1032 if (ITBlock.instrInITBlock())
1033 ITBlock.advanceITState();
1034 else if (VPTBlock.instrInVPTBlock()) {
1035 CC = VPTBlock.getVPTPred();
1036 VPTBlock.advanceVPTState();
1043 for (
unsigned i = 0; i < NumOps; ++i, ++
I) {
1044 if (OpInfo[i].isPredicate() ) {
1050 I->setReg(ARM::NoRegister);
1052 I->setReg(ARM::CPSR);
1062 CommentStream = &CS;
1064 assert(STI.hasFeature(ARM::ModeThumb) &&
1065 "Asked to disassemble in Thumb mode but Subtarget is in ARM mode!");
1068 if (Bytes.
size() < 2) {
1073 uint16_t Insn16 = llvm::support::endian::read<uint16_t>(
1074 Bytes.
data(), InstructionEndianness);
1076 decodeInstruction(DecoderTableThumb16,
MI, Insn16, Address,
this, STI);
1079 Check(Result, AddThumbPredicate(
MI));
1083 Result = decodeInstruction(DecoderTableThumbSBit16,
MI, Insn16, Address,
this,
1087 bool InITBlock = ITBlock.instrInITBlock();
1088 Check(Result, AddThumbPredicate(
MI));
1089 AddThumb1SBit(
MI, InITBlock);
1094 decodeInstruction(DecoderTableThumb216,
MI, Insn16, Address,
this, STI);
1100 if (
MI.getOpcode() == ARM::t2IT && ITBlock.instrInITBlock())
1103 Check(Result, AddThumbPredicate(
MI));
1108 if (
MI.getOpcode() == ARM::t2IT) {
1109 unsigned Firstcond =
MI.getOperand(0).getImm();
1110 unsigned Mask =
MI.getOperand(1).getImm();
1111 ITBlock.setITState(Firstcond, Mask);
1115 CS <<
"unpredictable IT predicate sequence";
1122 if (Bytes.
size() < 4) {
1128 (
uint32_t(Insn16) << 16) | llvm::support::endian::read<uint16_t>(
1129 Bytes.
data() + 2, InstructionEndianness);
1132 decodeInstruction(DecoderTableMVE32,
MI, Insn32, Address,
this, STI);
1138 if (
isVPTOpcode(
MI.getOpcode()) && VPTBlock.instrInVPTBlock())
1141 Check(Result, AddThumbPredicate(
MI));
1144 unsigned Mask =
MI.getOperand(0).getImm();
1145 VPTBlock.setVPTState(Mask);
1152 decodeInstruction(DecoderTableThumb32,
MI, Insn32, Address,
this, STI);
1155 bool InITBlock = ITBlock.instrInITBlock();
1156 Check(Result, AddThumbPredicate(
MI));
1157 AddThumb1SBit(
MI, InITBlock);
1162 decodeInstruction(DecoderTableThumb232,
MI, Insn32, Address,
this, STI);
1165 Check(Result, AddThumbPredicate(
MI));
1171 decodeInstruction(DecoderTableVFP32,
MI, Insn32, Address,
this, STI);
1174 UpdateThumbVFPPredicate(Result,
MI);
1180 decodeInstruction(DecoderTableVFPV832,
MI, Insn32, Address,
this, STI);
1187 Result = decodeInstruction(DecoderTableNEONDup32,
MI, Insn32, Address,
this,
1191 Check(Result, AddThumbPredicate(
MI));
1198 NEONLdStInsn &= 0xF0FFFFFF;
1199 NEONLdStInsn |= 0x04000000;
1200 Result = decodeInstruction(DecoderTableNEONLoadStore32,
MI, NEONLdStInsn,
1201 Address,
this, STI);
1204 Check(Result, AddThumbPredicate(
MI));
1211 NEONDataInsn &= 0xF0FFFFFF;
1212 NEONDataInsn |= (NEONDataInsn & 0x10000000) >> 4;
1213 NEONDataInsn |= 0x12000000;
1214 Result = decodeInstruction(DecoderTableNEONData32,
MI, NEONDataInsn,
1215 Address,
this, STI);
1218 Check(Result, AddThumbPredicate(
MI));
1223 NEONCryptoInsn &= 0xF0FFFFFF;
1224 NEONCryptoInsn |= (NEONCryptoInsn & 0x10000000) >> 4;
1225 NEONCryptoInsn |= 0x12000000;
1226 Result = decodeInstruction(DecoderTablev8Crypto32,
MI, NEONCryptoInsn,
1227 Address,
this, STI);
1234 NEONv8Insn &= 0xF3FFFFFF;
1235 Result = decodeInstruction(DecoderTablev8NEON32,
MI, NEONv8Insn, Address,
1245 ? DecoderTableThumb2CDE32
1246 : DecoderTableThumb2CoProc32;
1248 decodeInstruction(DecoderTable,
MI, Insn32, Address,
this, STI);
1251 Check(Result, AddThumbPredicate(
MI));
1257 if (ITBlock.instrInITBlock())
1258 ITBlock.advanceITState();
1276 ARM::R0, ARM::R1, ARM::R2, ARM::R3,
1277 ARM::R4, ARM::R5, ARM::R6, ARM::R7,
1278 ARM::R8, ARM::R9, ARM::R10, ARM::R11,
1279 ARM::R12, ARM::SP, ARM::LR, ARM::PC
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, 0, ARM::LR, ARM::APSR
1392 ARM::R0_R1, ARM::R2_R3, ARM::R4_R5, ARM::R6_R7,
1393 ARM::R8_R9, ARM::R10_R11, ARM::R12_SP
1423 if ((RegNo & 1) || RegNo > 10)
1478 if ((RegNo == 13 && !featureBits[ARM::HasV8Ops]) || RegNo == 15)
1486 ARM::S0, ARM::S1, ARM::S2, ARM::S3,
1487 ARM::S4, ARM::S5, ARM::S6, ARM::S7,
1488 ARM::S8, ARM::S9, ARM::S10, ARM::S11,
1489 ARM::S12, ARM::S13, ARM::S14, ARM::S15,
1490 ARM::S16, ARM::S17, ARM::S18, ARM::S19,
1491 ARM::S20, ARM::S21, ARM::S22, ARM::S23,
1492 ARM::S24, ARM::S25, ARM::S26, ARM::S27,
1493 ARM::S28, ARM::S29, ARM::S30, ARM::S31
1514 ARM::D0, ARM::D1, ARM::D2, ARM::D3,
1515 ARM::D4, ARM::D5, ARM::D6, ARM::D7,
1516 ARM::D8, ARM::D9, ARM::D10, ARM::D11,
1517 ARM::D12, ARM::D13, ARM::D14, ARM::D15,
1518 ARM::D16, ARM::D17, ARM::D18, ARM::D19,
1519 ARM::D20, ARM::D21, ARM::D22, ARM::D23,
1520 ARM::D24, ARM::D25, ARM::D26, ARM::D27,
1521 ARM::D28, ARM::D29, ARM::D30, ARM::D31
1530 return featureBits[ARM::FeatureD32];
1536 if (RegNo > (
PermitsD32(Inst, Decoder) ? 31u : 15u))
1569 ARM::Q0, ARM::Q1, ARM::Q2, ARM::Q3,
1570 ARM::Q4, ARM::Q5, ARM::Q6, ARM::Q7,
1571 ARM::Q8, ARM::Q9, ARM::Q10, ARM::Q11,
1572 ARM::Q12, ARM::Q13, ARM::Q14, ARM::Q15
1578 if (RegNo > 31 || (RegNo & 1) != 0)
1588 ARM::Q0, ARM::D1_D2, ARM::Q1, ARM::D3_D4, ARM::Q2, ARM::D5_D6,
1589 ARM::Q3, ARM::D7_D8, ARM::Q4, ARM::D9_D10, ARM::Q5, ARM::D11_D12,
1590 ARM::Q6, ARM::D13_D14, ARM::Q7, ARM::D15_D16, ARM::Q8, ARM::D17_D18,
1591 ARM::Q9, ARM::D19_D20, ARM::Q10, ARM::D21_D22, ARM::Q11, ARM::D23_D24,
1592 ARM::Q12, ARM::D25_D26, ARM::Q13, ARM::D27_D28, ARM::Q14, ARM::D29_D30,
1608 ARM::D0_D2, ARM::D1_D3, ARM::D2_D4, ARM::D3_D5,
1609 ARM::D4_D6, ARM::D5_D7, ARM::D6_D8, ARM::D7_D9,
1610 ARM::D8_D10, ARM::D9_D11, ARM::D10_D12, ARM::D11_D13,
1611 ARM::D12_D14, ARM::D13_D15, ARM::D14_D16, ARM::D15_D17,
1612 ARM::D16_D18, ARM::D17_D19, ARM::D18_D20, ARM::D19_D21,
1613 ARM::D20_D22, ARM::D21_D23, ARM::D22_D24, ARM::D23_D25,
1614 ARM::D24_D26, ARM::D25_D27, ARM::D26_D28, ARM::D27_D29,
1615 ARM::D28_D30, ARM::D29_D31
1635 if (Inst.
getOpcode() == ARM::tBcc && Val == 0xE)
1638 static_cast<const ARMDisassembler *
>(Decoder)->MCII.
get();
1691 unsigned Op = Shift | (imm << 3);
1738 bool NeedDisjointWriteback =
false;
1744 case ARM::LDMIA_UPD:
1745 case ARM::LDMDB_UPD:
1746 case ARM::LDMIB_UPD:
1747 case ARM::LDMDA_UPD:
1748 case ARM::t2LDMIA_UPD:
1749 case ARM::t2LDMDB_UPD:
1750 case ARM::t2STMIA_UPD:
1751 case ARM::t2STMDB_UPD:
1752 NeedDisjointWriteback =
true;
1762 for (
unsigned i = 0; i < 16; ++i) {
1763 if (Val & (1 << i)) {
1772 if (NeedDisjointWriteback && WritebackReg == Inst.
end()[-1].getReg())
1790 if (regs == 0 || (Vd + regs) > 32) {
1791 regs = Vd + regs > 32 ? 32 - Vd : regs;
1792 regs = std::max( 1u, regs);
1798 for (
unsigned i = 0; i < (regs - 1); ++i) {
1815 unsigned MaxReg =
PermitsD32(Inst, Decoder) ? 32 : 16;
1816 if (regs == 0 || (Vd + regs) > MaxReg) {
1817 regs = Vd + regs > MaxReg ? MaxReg - Vd : regs;
1818 regs = std::max( 1u, regs);
1819 regs = std::min(MaxReg, regs);
1825 for (
unsigned i = 0; i < (regs - 1); ++i) {
1854 if (msb != 31) msb_mask = (1U << (msb+1)) - 1;
1855 uint32_t lsb_mask = (1U << lsb) - 1;
1876 case ARM::LDC_OFFSET:
1879 case ARM::LDC_OPTION:
1880 case ARM::LDCL_OFFSET:
1882 case ARM::LDCL_POST:
1883 case ARM::LDCL_OPTION:
1884 case ARM::STC_OFFSET:
1887 case ARM::STC_OPTION:
1888 case ARM::STCL_OFFSET:
1890 case ARM::STCL_POST:
1891 case ARM::STCL_OPTION:
1892 case ARM::t2LDC_OFFSET:
1893 case ARM::t2LDC_PRE:
1894 case ARM::t2LDC_POST:
1895 case ARM::t2LDC_OPTION:
1896 case ARM::t2LDCL_OFFSET:
1897 case ARM::t2LDCL_PRE:
1898 case ARM::t2LDCL_POST:
1899 case ARM::t2LDCL_OPTION:
1900 case ARM::t2STC_OFFSET:
1901 case ARM::t2STC_PRE:
1902 case ARM::t2STC_POST:
1903 case ARM::t2STC_OPTION:
1904 case ARM::t2STCL_OFFSET:
1905 case ARM::t2STCL_PRE:
1906 case ARM::t2STCL_POST:
1907 case ARM::t2STCL_OPTION:
1908 case ARM::t2LDC2_OFFSET:
1909 case ARM::t2LDC2L_OFFSET:
1910 case ARM::t2LDC2_PRE:
1911 case ARM::t2LDC2L_PRE:
1912 case ARM::t2STC2_OFFSET:
1913 case ARM::t2STC2L_OFFSET:
1914 case ARM::t2STC2_PRE:
1915 case ARM::t2STC2L_PRE:
1916 case ARM::LDC2_OFFSET:
1917 case ARM::LDC2L_OFFSET:
1919 case ARM::LDC2L_PRE:
1920 case ARM::STC2_OFFSET:
1921 case ARM::STC2L_OFFSET:
1923 case ARM::STC2L_PRE:
1924 case ARM::t2LDC2_OPTION:
1925 case ARM::t2STC2_OPTION:
1926 case ARM::t2LDC2_POST:
1927 case ARM::t2LDC2L_POST:
1928 case ARM::t2STC2_POST:
1929 case ARM::t2STC2L_POST:
1930 case ARM::LDC2_POST:
1931 case ARM::LDC2L_POST:
1932 case ARM::STC2_POST:
1933 case ARM::STC2L_POST:
1934 if (coproc == 0xA || coproc == 0xB ||
1935 (featureBits[ARM::HasV8_1MMainlineOps] &&
1936 (coproc == 0x8 || coproc == 0x9 || coproc == 0xA || coproc == 0xB ||
1937 coproc == 0xE || coproc == 0xF)))
1944 if (featureBits[ARM::HasV8Ops] && (coproc != 14))
1953 case ARM::t2LDC2_OFFSET:
1954 case ARM::t2LDC2L_OFFSET:
1955 case ARM::t2LDC2_PRE:
1956 case ARM::t2LDC2L_PRE:
1957 case ARM::t2STC2_OFFSET:
1958 case ARM::t2STC2L_OFFSET:
1959 case ARM::t2STC2_PRE:
1960 case ARM::t2STC2L_PRE:
1961 case ARM::LDC2_OFFSET:
1962 case ARM::LDC2L_OFFSET:
1964 case ARM::LDC2L_PRE:
1965 case ARM::STC2_OFFSET:
1966 case ARM::STC2L_OFFSET:
1968 case ARM::STC2L_PRE:
1969 case ARM::t2LDC_OFFSET:
1970 case ARM::t2LDCL_OFFSET:
1971 case ARM::t2LDC_PRE:
1972 case ARM::t2LDCL_PRE:
1973 case ARM::t2STC_OFFSET:
1974 case ARM::t2STCL_OFFSET:
1975 case ARM::t2STC_PRE:
1976 case ARM::t2STCL_PRE:
1977 case ARM::LDC_OFFSET:
1978 case ARM::LDCL_OFFSET:
1981 case ARM::STC_OFFSET:
1982 case ARM::STCL_OFFSET:
1988 case ARM::t2LDC2_POST:
1989 case ARM::t2LDC2L_POST:
1990 case ARM::t2STC2_POST:
1991 case ARM::t2STC2L_POST:
1992 case ARM::LDC2_POST:
1993 case ARM::LDC2L_POST:
1994 case ARM::STC2_POST:
1995 case ARM::STC2L_POST:
1996 case ARM::t2LDC_POST:
1997 case ARM::t2LDCL_POST:
1998 case ARM::t2STC_POST:
1999 case ARM::t2STCL_POST:
2001 case ARM::LDCL_POST:
2003 case ARM::STCL_POST:
2014 case ARM::LDC_OFFSET:
2017 case ARM::LDC_OPTION:
2018 case ARM::LDCL_OFFSET:
2020 case ARM::LDCL_POST:
2021 case ARM::LDCL_OPTION:
2022 case ARM::STC_OFFSET:
2025 case ARM::STC_OPTION:
2026 case ARM::STCL_OFFSET:
2028 case ARM::STCL_POST:
2029 case ARM::STCL_OPTION:
2056 case ARM::STR_POST_IMM:
2057 case ARM::STR_POST_REG:
2058 case ARM::STRB_POST_IMM:
2059 case ARM::STRB_POST_REG:
2060 case ARM::STRT_POST_REG:
2061 case ARM::STRT_POST_IMM:
2062 case ARM::STRBT_POST_REG:
2063 case ARM::STRBT_POST_IMM:
2076 case ARM::LDR_POST_IMM:
2077 case ARM::LDR_POST_REG:
2078 case ARM::LDRB_POST_IMM:
2079 case ARM::LDRB_POST_REG:
2080 case ARM::LDRBT_POST_REG:
2081 case ARM::LDRBT_POST_IMM:
2082 case ARM::LDRT_POST_REG:
2083 case ARM::LDRT_POST_IMM:
2098 bool writeback = (
P == 0) || (W == 1);
2099 unsigned idx_mode = 0;
2102 else if (!
P && writeback)
2105 if (writeback && (Rn == 15 || Rn == Rt))
2213 unsigned U = ((~fieldFromInstruction(Insn, 23, 1)) & 1) << 8;
2217 unsigned Rt2 = Rt + 1;
2219 bool writeback = (W == 1) | (
P == 0);
2225 case ARM::STRD_POST:
2228 case ARM::LDRD_POST:
2237 case ARM::STRD_POST:
2238 if (
P == 0 && W == 1)
2241 if (writeback && (Rn == 15 || Rn == Rt || Rn == Rt2))
2243 if (type && Rm == 15)
2252 case ARM::STRH_POST:
2255 if (writeback && (Rn == 15 || Rn == Rt))
2257 if (!type && Rm == 15)
2262 case ARM::LDRD_POST:
2263 if (type && Rn == 15) {
2268 if (
P == 0 && W == 1)
2270 if (!type && (Rt2 == 15 || Rm == 15 || Rm == Rt || Rm == Rt2))
2272 if (!type && writeback && Rn == 15)
2274 if (writeback && (Rn == Rt || Rn == Rt2))
2279 case ARM::LDRH_POST:
2280 if (type && Rn == 15) {
2287 if (!type && Rm == 15)
2289 if (!type && writeback && (Rn == 15 || Rn == Rt))
2293 case ARM::LDRSH_PRE:
2294 case ARM::LDRSH_POST:
2296 case ARM::LDRSB_PRE:
2297 case ARM::LDRSB_POST:
2298 if (type && Rn == 15) {
2303 if (type && (Rt == 15 || (writeback && Rn == Rt)))
2305 if (!type && (Rt == 15 || Rm == 15))
2307 if (!type && writeback && (Rn == 15 || Rn == Rt))
2324 case ARM::STRD_POST:
2327 case ARM::STRH_POST:
2341 case ARM::STRD_POST:
2344 case ARM::LDRD_POST:
2357 case ARM::LDRD_POST:
2360 case ARM::LDRH_POST:
2362 case ARM::LDRSH_PRE:
2363 case ARM::LDRSH_POST:
2365 case ARM::LDRSB_PRE:
2366 case ARM::LDRSB_POST:
2465 case ARM::LDMDA_UPD:
2471 case ARM::LDMDB_UPD:
2477 case ARM::LDMIA_UPD:
2483 case ARM::LDMIB_UPD:
2489 case ARM::STMDA_UPD:
2495 case ARM::STMDB_UPD:
2501 case ARM::STMIA_UPD:
2507 case ARM::STMIB_UPD:
2559 if (imm8 == 0x10 && pred != 0xe && ((FeatureBits[ARM::FeatureRAS]) != 0))
2594 }
else if (imod && !M) {
2599 }
else if (!imod && M) {
2635 }
else if (imod && !M) {
2640 }
else if (!imod && M) {
2661 unsigned Opcode = ARM::t2HINT;
2664 Opcode = ARM::t2PACBTI;
2665 }
else if (imm == 0x1D) {
2666 Opcode = ARM::t2PAC;
2667 }
else if (imm == 0x2D) {
2668 Opcode = ARM::t2AUT;
2669 }
else if (imm == 0x0F) {
2670 Opcode = ARM::t2BTI;
2674 if (Opcode == ARM::t2HINT) {
2795 if (!FeatureBits[ARM::HasV8_1aOps] ||
2796 !FeatureBits[ARM::HasV8Ops])
2826 if (!add) imm *= -1;
2827 if (imm == 0 && !add) imm = INT32_MIN;
2897 unsigned I1 = !(J1 ^ S);
2898 unsigned I2 = !(J2 ^ S);
2901 unsigned tmp = (S << 23) | (I1 << 22) | (I2 << 21) | (imm10 << 11) | imm11;
2902 int imm32 = SignExtend32<25>(tmp << 1);
2904 true, 4, Inst, Decoder))
2922 true, 4, Inst, Decoder))
2928 true, 4, Inst, Decoder))
2972 case ARM::VLD1q16:
case ARM::VLD1q32:
case ARM::VLD1q64:
case ARM::VLD1q8:
2973 case ARM::VLD1q16wb_fixed:
case ARM::VLD1q16wb_register:
2974 case ARM::VLD1q32wb_fixed:
case ARM::VLD1q32wb_register:
2975 case ARM::VLD1q64wb_fixed:
case ARM::VLD1q64wb_register:
2976 case ARM::VLD1q8wb_fixed:
case ARM::VLD1q8wb_register:
2977 case ARM::VLD2d16:
case ARM::VLD2d32:
case ARM::VLD2d8:
2978 case ARM::VLD2d16wb_fixed:
case ARM::VLD2d16wb_register:
2979 case ARM::VLD2d32wb_fixed:
case ARM::VLD2d32wb_register:
2980 case ARM::VLD2d8wb_fixed:
case ARM::VLD2d8wb_register:
2987 case ARM::VLD2b16wb_fixed:
2988 case ARM::VLD2b16wb_register:
2989 case ARM::VLD2b32wb_fixed:
2990 case ARM::VLD2b32wb_register:
2991 case ARM::VLD2b8wb_fixed:
2992 case ARM::VLD2b8wb_register:
3006 case ARM::VLD3d8_UPD:
3007 case ARM::VLD3d16_UPD:
3008 case ARM::VLD3d32_UPD:
3012 case ARM::VLD4d8_UPD:
3013 case ARM::VLD4d16_UPD:
3014 case ARM::VLD4d32_UPD:
3021 case ARM::VLD3q8_UPD:
3022 case ARM::VLD3q16_UPD:
3023 case ARM::VLD3q32_UPD:
3027 case ARM::VLD4q8_UPD:
3028 case ARM::VLD4q16_UPD:
3029 case ARM::VLD4q32_UPD:
3042 case ARM::VLD3d8_UPD:
3043 case ARM::VLD3d16_UPD:
3044 case ARM::VLD3d32_UPD:
3048 case ARM::VLD4d8_UPD:
3049 case ARM::VLD4d16_UPD:
3050 case ARM::VLD4d32_UPD:
3057 case ARM::VLD3q8_UPD:
3058 case ARM::VLD3q16_UPD:
3059 case ARM::VLD3q32_UPD:
3063 case ARM::VLD4q8_UPD:
3064 case ARM::VLD4q16_UPD:
3065 case ARM::VLD4q32_UPD:
3078 case ARM::VLD4d8_UPD:
3079 case ARM::VLD4d16_UPD:
3080 case ARM::VLD4d32_UPD:
3087 case ARM::VLD4q8_UPD:
3088 case ARM::VLD4q16_UPD:
3089 case ARM::VLD4q32_UPD:
3099 case ARM::VLD1d8wb_fixed:
3100 case ARM::VLD1d16wb_fixed:
3101 case ARM::VLD1d32wb_fixed:
3102 case ARM::VLD1d64wb_fixed:
3103 case ARM::VLD1d8wb_register:
3104 case ARM::VLD1d16wb_register:
3105 case ARM::VLD1d32wb_register:
3106 case ARM::VLD1d64wb_register:
3107 case ARM::VLD1q8wb_fixed:
3108 case ARM::VLD1q16wb_fixed:
3109 case ARM::VLD1q32wb_fixed:
3110 case ARM::VLD1q64wb_fixed:
3111 case ARM::VLD1q8wb_register:
3112 case ARM::VLD1q16wb_register:
3113 case ARM::VLD1q32wb_register:
3114 case ARM::VLD1q64wb_register:
3115 case ARM::VLD1d8Twb_fixed:
3116 case ARM::VLD1d8Twb_register:
3117 case ARM::VLD1d16Twb_fixed:
3118 case ARM::VLD1d16Twb_register:
3119 case ARM::VLD1d32Twb_fixed:
3120 case ARM::VLD1d32Twb_register:
3121 case ARM::VLD1d64Twb_fixed:
3122 case ARM::VLD1d64Twb_register:
3123 case ARM::VLD1d8Qwb_fixed:
3124 case ARM::VLD1d8Qwb_register:
3125 case ARM::VLD1d16Qwb_fixed:
3126 case ARM::VLD1d16Qwb_register:
3127 case ARM::VLD1d32Qwb_fixed:
3128 case ARM::VLD1d32Qwb_register:
3129 case ARM::VLD1d64Qwb_fixed:
3130 case ARM::VLD1d64Qwb_register:
3131 case ARM::VLD2d8wb_fixed:
3132 case ARM::VLD2d16wb_fixed:
3133 case ARM::VLD2d32wb_fixed:
3134 case ARM::VLD2q8wb_fixed:
3135 case ARM::VLD2q16wb_fixed:
3136 case ARM::VLD2q32wb_fixed:
3137 case ARM::VLD2d8wb_register:
3138 case ARM::VLD2d16wb_register:
3139 case ARM::VLD2d32wb_register:
3140 case ARM::VLD2q8wb_register:
3141 case ARM::VLD2q16wb_register:
3142 case ARM::VLD2q32wb_register:
3143 case ARM::VLD2b8wb_fixed:
3144 case ARM::VLD2b16wb_fixed:
3145 case ARM::VLD2b32wb_fixed:
3146 case ARM::VLD2b8wb_register:
3147 case ARM::VLD2b16wb_register:
3148 case ARM::VLD2b32wb_register:
3151 case ARM::VLD3d8_UPD:
3152 case ARM::VLD3d16_UPD:
3153 case ARM::VLD3d32_UPD:
3154 case ARM::VLD3q8_UPD:
3155 case ARM::VLD3q16_UPD:
3156 case ARM::VLD3q32_UPD:
3157 case ARM::VLD4d8_UPD:
3158 case ARM::VLD4d16_UPD:
3159 case ARM::VLD4d32_UPD:
3160 case ARM::VLD4q8_UPD:
3161 case ARM::VLD4q16_UPD:
3162 case ARM::VLD4q32_UPD:
3189 case ARM::VLD1d8wb_fixed:
3190 case ARM::VLD1d16wb_fixed:
3191 case ARM::VLD1d32wb_fixed:
3192 case ARM::VLD1d64wb_fixed:
3193 case ARM::VLD1d8Twb_fixed:
3194 case ARM::VLD1d16Twb_fixed:
3195 case ARM::VLD1d32Twb_fixed:
3196 case ARM::VLD1d64Twb_fixed:
3197 case ARM::VLD1d8Qwb_fixed:
3198 case ARM::VLD1d16Qwb_fixed:
3199 case ARM::VLD1d32Qwb_fixed:
3200 case ARM::VLD1d64Qwb_fixed:
3201 case ARM::VLD1d8wb_register:
3202 case ARM::VLD1d16wb_register:
3203 case ARM::VLD1d32wb_register:
3204 case ARM::VLD1d64wb_register:
3205 case ARM::VLD1q8wb_fixed:
3206 case ARM::VLD1q16wb_fixed:
3207 case ARM::VLD1q32wb_fixed:
3208 case ARM::VLD1q64wb_fixed:
3209 case ARM::VLD1q8wb_register:
3210 case ARM::VLD1q16wb_register:
3211 case ARM::VLD1q32wb_register:
3212 case ARM::VLD1q64wb_register:
3216 if (Rm != 0xD && Rm != 0xF &&
3220 case ARM::VLD2d8wb_fixed:
3221 case ARM::VLD2d16wb_fixed:
3222 case ARM::VLD2d32wb_fixed:
3223 case ARM::VLD2b8wb_fixed:
3224 case ARM::VLD2b16wb_fixed:
3225 case ARM::VLD2b32wb_fixed:
3226 case ARM::VLD2q8wb_fixed:
3227 case ARM::VLD2q16wb_fixed:
3228 case ARM::VLD2q32wb_fixed:
3304 case ARM::VST1d8wb_fixed:
3305 case ARM::VST1d16wb_fixed:
3306 case ARM::VST1d32wb_fixed:
3307 case ARM::VST1d64wb_fixed:
3308 case ARM::VST1d8wb_register:
3309 case ARM::VST1d16wb_register:
3310 case ARM::VST1d32wb_register:
3311 case ARM::VST1d64wb_register:
3312 case ARM::VST1q8wb_fixed:
3313 case ARM::VST1q16wb_fixed:
3314 case ARM::VST1q32wb_fixed:
3315 case ARM::VST1q64wb_fixed:
3316 case ARM::VST1q8wb_register:
3317 case ARM::VST1q16wb_register:
3318 case ARM::VST1q32wb_register:
3319 case ARM::VST1q64wb_register:
3320 case ARM::VST1d8Twb_fixed:
3321 case ARM::VST1d16Twb_fixed:
3322 case ARM::VST1d32Twb_fixed:
3323 case ARM::VST1d64Twb_fixed:
3324 case ARM::VST1d8Twb_register:
3325 case ARM::VST1d16Twb_register:
3326 case ARM::VST1d32Twb_register:
3327 case ARM::VST1d64Twb_register:
3328 case ARM::VST1d8Qwb_fixed:
3329 case ARM::VST1d16Qwb_fixed:
3330 case ARM::VST1d32Qwb_fixed:
3331 case ARM::VST1d64Qwb_fixed:
3332 case ARM::VST1d8Qwb_register:
3333 case ARM::VST1d16Qwb_register:
3334 case ARM::VST1d32Qwb_register:
3335 case ARM::VST1d64Qwb_register:
3336 case ARM::VST2d8wb_fixed:
3337 case ARM::VST2d16wb_fixed:
3338 case ARM::VST2d32wb_fixed:
3339 case ARM::VST2d8wb_register:
3340 case ARM::VST2d16wb_register:
3341 case ARM::VST2d32wb_register:
3342 case ARM::VST2q8wb_fixed:
3343 case ARM::VST2q16wb_fixed:
3344 case ARM::VST2q32wb_fixed:
3345 case ARM::VST2q8wb_register:
3346 case ARM::VST2q16wb_register:
3347 case ARM::VST2q32wb_register:
3348 case ARM::VST2b8wb_fixed:
3349 case ARM::VST2b16wb_fixed:
3350 case ARM::VST2b32wb_fixed:
3351 case ARM::VST2b8wb_register:
3352 case ARM::VST2b16wb_register:
3353 case ARM::VST2b32wb_register:
3358 case ARM::VST3d8_UPD:
3359 case ARM::VST3d16_UPD:
3360 case ARM::VST3d32_UPD:
3361 case ARM::VST3q8_UPD:
3362 case ARM::VST3q16_UPD:
3363 case ARM::VST3q32_UPD:
3364 case ARM::VST4d8_UPD:
3365 case ARM::VST4d16_UPD:
3366 case ARM::VST4d32_UPD:
3367 case ARM::VST4q8_UPD:
3368 case ARM::VST4q16_UPD:
3369 case ARM::VST4q32_UPD:
3386 else if (Rm != 0xF) {
3391 case ARM::VST1d8wb_fixed:
3392 case ARM::VST1d16wb_fixed:
3393 case ARM::VST1d32wb_fixed:
3394 case ARM::VST1d64wb_fixed:
3395 case ARM::VST1q8wb_fixed:
3396 case ARM::VST1q16wb_fixed:
3397 case ARM::VST1q32wb_fixed:
3398 case ARM::VST1q64wb_fixed:
3399 case ARM::VST1d8Twb_fixed:
3400 case ARM::VST1d16Twb_fixed:
3401 case ARM::VST1d32Twb_fixed:
3402 case ARM::VST1d64Twb_fixed:
3403 case ARM::VST1d8Qwb_fixed:
3404 case ARM::VST1d16Qwb_fixed:
3405 case ARM::VST1d32Qwb_fixed:
3406 case ARM::VST1d64Qwb_fixed:
3407 case ARM::VST2d8wb_fixed:
3408 case ARM::VST2d16wb_fixed:
3409 case ARM::VST2d32wb_fixed:
3410 case ARM::VST2q8wb_fixed:
3411 case ARM::VST2q16wb_fixed:
3412 case ARM::VST2q32wb_fixed:
3413 case ARM::VST2b8wb_fixed:
3414 case ARM::VST2b16wb_fixed:
3415 case ARM::VST2b32wb_fixed:
3425 case ARM::VST1q16wb_fixed:
3426 case ARM::VST1q16wb_register:
3427 case ARM::VST1q32wb_fixed:
3428 case ARM::VST1q32wb_register:
3429 case ARM::VST1q64wb_fixed:
3430 case ARM::VST1q64wb_register:
3431 case ARM::VST1q8wb_fixed:
3432 case ARM::VST1q8wb_register:
3436 case ARM::VST2d16wb_fixed:
3437 case ARM::VST2d16wb_register:
3438 case ARM::VST2d32wb_fixed:
3439 case ARM::VST2d32wb_register:
3440 case ARM::VST2d8wb_fixed:
3441 case ARM::VST2d8wb_register:
3448 case ARM::VST2b16wb_fixed:
3449 case ARM::VST2b16wb_register:
3450 case ARM::VST2b32wb_fixed:
3451 case ARM::VST2b32wb_register:
3452 case ARM::VST2b8wb_fixed:
3453 case ARM::VST2b8wb_register:
3467 case ARM::VST3d8_UPD:
3468 case ARM::VST3d16_UPD:
3469 case ARM::VST3d32_UPD:
3473 case ARM::VST4d8_UPD:
3474 case ARM::VST4d16_UPD:
3475 case ARM::VST4d32_UPD:
3482 case ARM::VST3q8_UPD:
3483 case ARM::VST3q16_UPD:
3484 case ARM::VST3q32_UPD:
3488 case ARM::VST4q8_UPD:
3489 case ARM::VST4q16_UPD:
3490 case ARM::VST4q32_UPD:
3503 case ARM::VST3d8_UPD:
3504 case ARM::VST3d16_UPD:
3505 case ARM::VST3d32_UPD:
3509 case ARM::VST4d8_UPD:
3510 case ARM::VST4d16_UPD:
3511 case ARM::VST4d32_UPD:
3518 case ARM::VST3q8_UPD:
3519 case ARM::VST3q16_UPD:
3520 case ARM::VST3q32_UPD:
3524 case ARM::VST4q8_UPD:
3525 case ARM::VST4q16_UPD:
3526 case ARM::VST4q32_UPD:
3539 case ARM::VST4d8_UPD:
3540 case ARM::VST4d16_UPD:
3541 case ARM::VST4d32_UPD:
3548 case ARM::VST4q8_UPD:
3549 case ARM::VST4q16_UPD:
3550 case ARM::VST4q32_UPD:
3573 if (
size == 0 && align == 1)
3575 align *= (1 <<
size);
3578 case ARM::VLD1DUPq16:
case ARM::VLD1DUPq32:
case ARM::VLD1DUPq8:
3579 case ARM::VLD1DUPq16wb_fixed:
case ARM::VLD1DUPq16wb_register:
3580 case ARM::VLD1DUPq32wb_fixed:
case ARM::VLD1DUPq32wb_register:
3581 case ARM::VLD1DUPq8wb_fixed:
case ARM::VLD1DUPq8wb_register:
3602 if (Rm != 0xD && Rm != 0xF &&
3623 case ARM::VLD2DUPd16:
case ARM::VLD2DUPd32:
case ARM::VLD2DUPd8:
3624 case ARM::VLD2DUPd16wb_fixed:
case ARM::VLD2DUPd16wb_register:
3625 case ARM::VLD2DUPd32wb_fixed:
case ARM::VLD2DUPd32wb_register:
3626 case ARM::VLD2DUPd8wb_fixed:
case ARM::VLD2DUPd8wb_register:
3630 case ARM::VLD2DUPd16x2:
case ARM::VLD2DUPd32x2:
case ARM::VLD2DUPd8x2:
3631 case ARM::VLD2DUPd16x2wb_fixed:
case ARM::VLD2DUPd16x2wb_register:
3632 case ARM::VLD2DUPd32x2wb_fixed:
case ARM::VLD2DUPd32x2wb_register:
3633 case ARM::VLD2DUPd8x2wb_fixed:
case ARM::VLD2DUPd8x2wb_register:
3650 if (Rm != 0xD && Rm != 0xF) {
3686 else if (Rm != 0xF) {
3739 else if (Rm != 0xF) {
3772 case ARM::VORRiv4i16:
3773 case ARM::VORRiv2i32:
3774 case ARM::VBICiv4i16:
3775 case ARM::VBICiv2i32:
3779 case ARM::VORRiv8i16:
3780 case ARM::VORRiv4i32:
3781 case ARM::VBICiv8i16:
3782 case ARM::VBICiv4i32:
3807 if (cmode == 0xF && Inst.
getOpcode() == ARM::MVE_VMVNimmi32)
3962 true, 2, Inst, Decoder))
3971 true, 4, Inst, Decoder))
3980 true, 2, Inst, Decoder))
4019 unsigned imm = Val << 2;
4077 bool hasMP = featureBits[ARM::FeatureMP];
4078 bool hasV7Ops = featureBits[ARM::HasV7Ops];
4133 if (!hasV7Ops || !hasMP)
4166 bool hasMP = featureBits[ARM::FeatureMP];
4167 bool hasV7Ops = featureBits[ARM::HasV7Ops];
4177 case ARM::t2LDRSBi8:
4183 case ARM::t2LDRSHi8:
4200 case ARM::t2LDRSHi8:
4206 case ARM::t2LDRSBi8:
4222 if (!hasV7Ops || !hasMP)
4248 bool hasMP = featureBits[ARM::FeatureMP];
4249 bool hasV7Ops = featureBits[ARM::HasV7Ops];
4256 case ARM::t2LDRHi12:
4259 case ARM::t2LDRSHi12:
4262 case ARM::t2LDRBi12:
4265 case ARM::t2LDRSBi12:
4282 case ARM::t2LDRSHi12:
4284 case ARM::t2LDRHi12:
4287 case ARM::t2LDRSBi12:
4302 case ARM::t2PLDWi12:
4303 if (!hasV7Ops || !hasMP)
4367 bool hasV7Ops = featureBits[ARM::HasV7Ops];
4371 case ARM::t2LDRBpci:
4372 case ARM::t2LDRHpci:
4375 case ARM::t2LDRSBpci:
4378 case ARM::t2LDRSHpci:
4414 int imm = Val & 0xFF;
4416 if (!(Val & 0x100)) imm *= -1;
4428 int imm = Val & 0x7F;
4488 int imm = Val & 0xFF;
4491 else if (!(Val & 0x100))
4501 int imm = Val & 0x7F;
4504 else if (!(Val & 0x80))
4506 if (imm != INT32_MIN)
4507 imm *= (1U << shift);
4571 if (!
Check(S, DecodeT2Imm7<shift>(Inst, imm,
Address, Decoder)))
4577template <
int shift,
int WriteBack>
4590 if (!
Check(S, DecodeT2Imm7<shift>(Inst, imm,
Address, Decoder)))
4610 case ARM::t2LDR_PRE:
4611 case ARM::t2LDR_POST:
4614 case ARM::t2LDRB_PRE:
4615 case ARM::t2LDRB_POST:
4618 case ARM::t2LDRH_PRE:
4619 case ARM::t2LDRH_POST:
4622 case ARM::t2LDRSB_PRE:
4623 case ARM::t2LDRSB_POST:
4629 case ARM::t2LDRSH_PRE:
4630 case ARM::t2LDRSH_POST:
4669 case ARM::t2STRBi12:
4670 case ARM::t2STRHi12:
4711 }
else if (Inst.
getOpcode() == ARM::tADDspr) {
4781 if (imm != INT32_MIN)
4782 imm *= (1U << shift);
4798 unsigned S = (Val >> 23) & 1;
4799 unsigned J1 = (Val >> 22) & 1;
4800 unsigned J2 = (Val >> 21) & 1;
4801 unsigned I1 = !(J1 ^ S);
4802 unsigned I2 = !(J2 ^ S);
4803 unsigned tmp = (Val & ~0x600000) | (I1 << 22) | (I2 << 21);
4804 int imm32 = SignExtend32<25>(tmp << 1);
4808 true, 4, Inst, Decoder))
4816 if (Val == 0xA || Val == 0xB)
4853 if (pred == 0xE || pred == 0xF) {
4914 unsigned imm = llvm::rotr<uint32_t>(unrot, rot);
4925 true, 2, Inst, Decoder))
4940 unsigned S = (Val >> 23) & 1;
4941 unsigned J1 = (Val >> 22) & 1;
4942 unsigned J2 = (Val >> 21) & 1;
4943 unsigned I1 = !(J1 ^ S);
4944 unsigned I2 = !(J2 ^ S);
4945 unsigned tmp = (Val & ~0x600000) | (I1 << 22) | (I2 << 21);
4946 int imm32 = SignExtend32<25>(tmp << 1);
4949 true, 4, Inst, Decoder))
4980 if (FeatureBits[ARM::FeatureMClass]) {
4981 unsigned ValLow = Val & 0xff;
5000 if (!(FeatureBits[ARM::HasV7Ops]))
5008 if (!(FeatureBits[ARM::HasV8MMainlineOps]))
5018 if (!(FeatureBits[ARM::Feature8MSecExt]))
5037 if (!(FeatureBits[ARM::FeaturePACBTI]))
5048 if (!(FeatureBits[ARM::HasV7Ops])) {
5061 if (Mask == 0 || (Mask != 2 && ValLow > 3) ||
5062 (!(FeatureBits[ARM::FeatureDSP]) && (Mask & 1)))
5084 if (!ARMBankedReg::lookupBankedRegByEncoding((R << 5) | SysM))
5126 if (Rn == 0xF || Rd == Rn || Rd == Rt || Rd == Rt+1)
5802 if (Rt == 0xF || Rt2 == 0xF || Rm == 0x1F)
5828 if (Rt == 0xF || Rt2 == 0xF || Rm == 0x1F)
5864 unsigned LowBit = mask & -mask;
5865 unsigned BitsAboveLowBit = 0xF & (-LowBit << 1);
5866 mask ^= BitsAboveLowBit;
5886 bool writeback = (W == 1) | (
P == 0);
5888 addr |= (U << 8) | (Rn << 9);
5890 if (writeback && (Rn == Rt || Rn == Rt2))
5923 bool writeback = (W == 1) | (
P == 0);
5925 addr |= (U << 8) | (Rn << 9);
5927 if (writeback && (Rn == Rt || Rn == Rt2))
5995 if (Rt == Rn || Rn == Rt2)
6014 bool hasFullFP16 = featureBits[ARM::FeatureFullFP16];
6027 if (!(imm & 0x38)) {
6073 bool hasFullFP16 = featureBits[ARM::FeatureFullFP16];
6086 if (!(imm & 0x38)) {
6145 if (!
Check(S, DestRegDecoder(Inst, Vd,
Address, Decoder)))
6147 if (!
Check(S, DestRegDecoder(Inst, Vd,
Address, Decoder)))
6149 if (!
Check(S, DestRegDecoder(Inst, Vn,
Address, Decoder)))
6199 if ((cop & ~0x1) == 0xa)
6244 case ARM::VMSR_FPSCR_NZCVQC:
6255 if (featureBits[ARM::ModeThumb] && !featureBits[ARM::HasV8Ops]) {
6256 if (Rt == 13 || Rt == 15)
6265 case ARM::VMRS_FPSCR_NZCVQC:
6273 if (featureBits[ARM::ModeThumb]) {
6285template <
bool isSigned,
bool isNeg,
bool zeroPermitted,
int size>
6290 if (Val == 0 && !zeroPermitted)
6295 DecVal = SignExtend32<size + 1>(Val << 1);
6297 DecVal = (Val << 1);
6310 Val = LocImm + (2 << Val);
6336 case ARM::t2LEUpdate:
6342 if (!
Check(S, DecodeBFLabelOperand<false, true, true, 11>(
6343 Inst, Imm,
Address, Decoder)))
6347 case ARM::MVE_WLSTP_8:
6348 case ARM::MVE_WLSTP_16:
6349 case ARM::MVE_WLSTP_32:
6350 case ARM::MVE_WLSTP_64:
6355 !
Check(S, DecodeBFLabelOperand<false, false, true, 11>(
6356 Inst, Imm,
Address, Decoder)))
6360 case ARM::MVE_DLSTP_8:
6361 case ARM::MVE_DLSTP_16:
6362 case ARM::MVE_DLSTP_32:
6363 case ARM::MVE_DLSTP_64:
6369 uint32_t CanonicalLCTP = 0xF00FE001, SBZMask = 0x00300FFE;
6370 if ((Insn & ~SBZMask) != CanonicalLCTP)
6372 if (Insn != CanonicalLCTP)
6404 if ((RegNo) + 1 > 11)
6450 }
else if (Inst.
getOpcode() == ARM::VSCCLRMD) {
6461 unsigned max_reg = Vd + regs;
6462 if (max_reg > 64 || (max_reg > 32 && (max_reg & 1)))
6464 unsigned max_sreg = std::min(32u, max_reg);
6465 unsigned max_dreg = std::min(32u, max_reg / 2);
6466 for (
unsigned i = Vd; i < max_sreg; ++i)
6469 for (
unsigned i = 16; i < max_dreg; ++i)
6490 ARM::Q0_Q1, ARM::Q1_Q2, ARM::Q2_Q3, ARM::Q3_Q4,
6491 ARM::Q4_Q5, ARM::Q5_Q6, ARM::Q6_Q7
6506 ARM::Q0_Q1_Q2_Q3, ARM::Q1_Q2_Q3_Q4, ARM::Q2_Q3_Q4_Q5,
6507 ARM::Q3_Q4_Q5_Q6, ARM::Q4_Q5_Q6_Q7
6531 unsigned CurBit = 0;
6532 for (
int i = 3; i >= 0; --i) {
6535 CurBit ^= (Val >> i) & 1U;
6538 Imm |= (CurBit << i);
6541 if ((Val & ~(~0U << i)) == 0) {
6587 switch (Val & 0x3) {
6648 unsigned DecodedVal = 64 - Val;
6651 case ARM::MVE_VCVTf16s16_fix:
6652 case ARM::MVE_VCVTs16f16_fix:
6653 case ARM::MVE_VCVTf16u16_fix:
6654 case ARM::MVE_VCVTu16f16_fix:
6655 if (DecodedVal > 16)
6658 case ARM::MVE_VCVTf32s32_fix:
6659 case ARM::MVE_VCVTs32f32_fix:
6660 case ARM::MVE_VCVTf32u32_fix:
6661 case ARM::MVE_VCVTu32f32_fix:
6662 if (DecodedVal > 32)
6674 case ARM::VSTR_P0_off:
6675 case ARM::VSTR_P0_pre:
6676 case ARM::VSTR_P0_post:
6677 case ARM::VLDR_P0_off:
6678 case ARM::VLDR_P0_pre:
6679 case ARM::VLDR_P0_post:
6681 case ARM::VSTR_FPSCR_NZCVQC_off:
6682 case ARM::VSTR_FPSCR_NZCVQC_pre:
6683 case ARM::VSTR_FPSCR_NZCVQC_post:
6684 case ARM::VLDR_FPSCR_NZCVQC_off:
6685 case ARM::VLDR_FPSCR_NZCVQC_pre:
6686 case ARM::VLDR_FPSCR_NZCVQC_post:
6693template <
bool Writeback>
6698 case ARM::VSTR_FPSCR_pre:
6699 case ARM::VSTR_FPSCR_NZCVQC_pre:
6700 case ARM::VLDR_FPSCR_pre:
6701 case ARM::VLDR_FPSCR_NZCVQC_pre:
6702 case ARM::VSTR_FPSCR_off:
6703 case ARM::VSTR_FPSCR_NZCVQC_off:
6704 case ARM::VLDR_FPSCR_off:
6705 case ARM::VLDR_FPSCR_NZCVQC_off:
6706 case ARM::VSTR_FPSCR_post:
6707 case ARM::VSTR_FPSCR_NZCVQC_post:
6708 case ARM::VLDR_FPSCR_post:
6709 case ARM::VLDR_FPSCR_NZCVQC_post:
6713 if (!featureBits[ARM::HasMVEIntegerOps] && !featureBits[ARM::FeatureVFP2])
6751 if (!
Check(S, AddrDecoder(Inst, addr,
Address, Decoder)))
6764 DecodeTAddrModeImm7<shift>);
6774 DecodeT2AddrModeImm7<shift,1>);
6784 DecodeMveAddrModeQ<shift>);
6787template <
unsigned MinLog,
unsigned MaxLog>
6793 if (Val < MinLog || Val > MaxLog)
6800template <
unsigned start>
6827 if (!
Check(S, DecodeMVEPairVectorIndexOperand<2>(Inst, index,
Address, Decoder)))
6829 if (!
Check(S, DecodeMVEPairVectorIndexOperand<0>(Inst, index,
Address, Decoder)))
6853 if (!
Check(S, DecodeMVEPairVectorIndexOperand<2>(Inst, index,
Address, Decoder)))
6855 if (!
Check(S, DecodeMVEPairVectorIndexOperand<0>(Inst, index,
Address, Decoder)))
6879 case ARM::MVE_ASRLr:
6880 case ARM::MVE_SQRSHRL:
6883 case ARM::MVE_LSLLr:
6884 case ARM::MVE_UQRSHLL:
6931 if (Inst.
getOpcode() == ARM::MVE_SQRSHRL ||
6961template <
bool scalar, OperandDecoder predicate_decoder>
6989 if (!
Check(S, predicate_decoder(Inst, fc,
Address, Decoder)))
7040 Inst.
setOpcode(sign1 ? ARM::t2SUBspImm12 : ARM::t2ADDspImm12);
7043 Inst.
setOpcode(sign1 ? ARM::t2SUBspImm : ARM::t2ADDspImm);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
AMDGPU Mark last scratch load
static bool isVectorPredicable(const MCInstrDesc &MCID)
static DecodeStatus DecodeDPairSpacedRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeCCOutOperand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeAddrMode2IdxInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeT2AddrModeImm0_1020s4(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeT2AddrModeImm12(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static const uint16_t GPRPairDecoderTable[]
static DecodeStatus DecodeNEONComplexLane64Instruction(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeLDRPreReg(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeGPRPairnospRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeDoubleRegStore(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeT2SOImm(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeT2LoadT(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeAddrMode6Operand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVSHLMaxInstruction(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMVEVPNOT(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeGPRRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMVEVCMP(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMVEVMOVDRegtoQ(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeShiftRight16Imm(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeAddrMode5FP16Operand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSORegImmOperand(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static const MCPhysReg QQPRDecoderTable[]
static DecodeStatus DecodeT2LoadLabel(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeQPRRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSORegMemOperand(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeShiftRight64Imm(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeThumbTableBranch(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVLD4LN(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeDPRRegListOperand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecoderForMRRC2AndMCRR2(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeBitfieldMaskOperand(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeThumbAddrModePC(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMVEPairVectorIndexOperand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeThumb2BCCInstruction(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeGPRnopcRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeArmMOVTWInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeT2AddrModeImm8(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecoderGPRRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeTAddrModeImm7(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeBranchImmInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeT2AddrModeImm7s4(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static void tryAddingPcLoadReferenceComment(uint64_t Address, int Value, const MCDisassembler *Decoder)
tryAddingPcLoadReferenceComment - trys to add a comment as to what is being referenced by a load inst...
static DecodeStatus DecodeGPRwithAPSRRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeShiftRight32Imm(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARMDisassembler()
static DecodeStatus DecodeT2MOVTWInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static const MCPhysReg DPairDecoderTable[]
static DecodeStatus DecodeTSBInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMVE_MEM_1_pre(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeDoubleRegLoad(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVMOVModImmInstruction(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeThumbAddrModeIS(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodePowerTwoOperand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeT2Imm7S4(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeQADDInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static const MCPhysReg DPairSpacedDecoderTable[]
static DecodeStatus DecodeThumbBROperand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeRestrictedIPredicateOperand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSTRPreReg(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVLD1DupInstruction(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSPRRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSETPANInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeThumbAddSPReg(MCInst &Inst, uint16_t Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMQQQQPRRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVLD4DupInstruction(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeT2ShifterImmOperand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVLD2LN(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeT2AddSubSPImm(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static MCDisassembler * createARMDisassembler(const Target &T, const MCSubtargetInfo &STI, MCContext &Ctx)
static DecodeStatus DecodeT2LoadImm12(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static unsigned FixedRegForVSTRVLDR_SYSREG(unsigned Opcode)
static DecodeStatus DecodeVST1LN(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeLDR(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static const MCPhysReg QPRDecoderTable[]
static DecodeStatus DecodeVST3LN(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static const MCPhysReg SPRDecoderTable[]
static DecodeStatus DecodeRestrictedUPredicateOperand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodetGPRRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeCLRMGPRRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeAddrMode5Operand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMQQPRRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVMOVRRS(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeGPRwithAPSR_NZCVnospRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVLDST3Instruction(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
DecodeStatus OperandDecoder(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeThumbBLTargetOperand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVLDST2Instruction(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeAddrMode3Instruction(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSMLAInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSwap(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeGPRwithZRRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVCVTD(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeCopMemInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVLD3DupInstruction(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMemBarrierOption(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVpredNOperand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeDPR_VFP2RegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeT2CPSInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeThumbBCCTargetOperand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMVE_MEM_3_pre(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeIT(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVSTInstruction(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeAddrMode7Operand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeThumbAddrModeSP(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeT2STRDPreInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVLD1LN(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static bool PermitsD32(const MCInst &Inst, const MCDisassembler *Decoder)
static DecodeStatus DecodeVSTRVLDR_SYSREG(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeT2Imm8(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeThumbAddSPImm(MCInst &Inst, uint16_t Val, uint64_t Address, const MCDisassembler *Decoder)
static const uint16_t CLRMGPRDecoderTable[]
static const MCPhysReg DPRDecoderTable[]
static DecodeStatus DecodePostIdxReg(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeCoprocessor(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVLD3LN(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeT2LDRDPreInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeT2Imm8S4(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeThumbCPS(MCInst &Inst, uint16_t Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeCPSInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeThumbAddSpecialReg(MCInst &Inst, uint16_t Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeRestrictedSPredicateOperand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVCVTQ(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSPRRegListOperand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVLDST4Instruction(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeT2LdStPre(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeGPRPairRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMQPRRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVLDInstruction(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static bool tryAddingSymbolicOperand(uint64_t Address, int32_t Value, bool isBranch, uint64_t InstSize, MCInst &MI, const MCDisassembler *Decoder)
tryAddingSymbolicOperand - trys to add a symbolic operand in place of the immediate Value in the MCIn...
static DecodeStatus DecodeT2LoadImm8(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMVEModImmInstruction(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeGPRwithZRnospRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static const uint16_t GPRDecoderTable[]
static DecodeStatus DecodeVCVTImmOperand(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMveAddrModeQ(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeT2LoadShift(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeT2Imm7(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeDPRRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeThumbCmpBROperand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMVE_MEM_2_pre(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMVEVCVTt1fp(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMSRMask(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMVEVMOVQtoDReg(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static const MCPhysReg QQQQPRDecoderTable[]
static DecodeStatus DecodeLongShiftOperand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMveAddrModeRQ(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeBFAfterTargetOperand(MCInst &Inst, unsigned val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeGPRspRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMVE_MEM_pre(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder, unsigned Rn, OperandDecoder RnDecoder, OperandDecoder AddrDecoder)
static DecodeStatus DecodeT2AddrModeImm8s4(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVpredROperand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMveVCTP(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus checkDecodedInstruction(MCInst &MI, uint64_t &Size, uint64_t Address, raw_ostream &CS, uint32_t Insn, DecodeStatus Result)
static DecodeStatus DecodeVST4LN(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSTRPreImm(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodetcGPRRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodePredNoALOperand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVST2LN(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVLDST1Instruction(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVPTMaskOperand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeRegListOperand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMVEOverlappingLongShift(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeInstSyncBarrierOption(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodePredicateOperand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeT2AddrModeSOReg(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeShiftRight8Imm(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeT2AddrModeImm7(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVLD2DupInstruction(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeTSTInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeAddrModeImm12Operand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeTBLInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeLDRPreImm(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeT2HintSpaceInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeBFLabelOperand(MCInst &Inst, unsigned val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeHPRRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeDPairRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeRestrictedFPPredicateOperand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeHINTInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVSCCLRM(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeT2BROperand(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeBankedReg(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMVEVADCInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeRFEInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMemMultipleWritebackInstruction(MCInst &Inst, unsigned Insn, uint64_t Adddress, const MCDisassembler *Decoder)
static DecodeStatus DecodeT2BInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeThumbBLXOffset(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeDPR_8RegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodetGPREvenRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeThumbAddrModeRR(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodetGPROddRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeT2Adr(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeGPRnospRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSORegRegOperand(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSPR_8RegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVMOVSRR(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeLazyLoadStoreMul(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeForVMRSandVMSR(MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeLOLoop(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
#define LLVM_EXTERNAL_VISIBILITY
static bool isNeg(Value *V)
Returns true if the operation is a negation of V, and it works for both integers and floats.
static bool isSigned(unsigned int Opcode)
amode Optimize addressing mode
static bool isBranch(unsigned Opcode)
const SmallVectorImpl< MachineOperand > & Cond
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
This class represents an Operation in the Expression.
Container class for subtarget features.
Context object for machine code objects.
Superclass for all disassemblers.
bool tryAddingSymbolicOperand(MCInst &Inst, int64_t Value, uint64_t Address, bool IsBranch, uint64_t Offset, uint64_t OpSize, uint64_t InstSize) const
const MCSubtargetInfo & getSubtargetInfo() const
void tryAddingPcLoadReferenceComment(int64_t Value, uint64_t Address) const
virtual uint64_t suggestBytesToSkip(ArrayRef< uint8_t > Bytes, uint64_t Address) const
Suggest a distance to skip in a buffer of data to find the next place to look for the start of an ins...
DecodeStatus
Ternary decode status.
virtual DecodeStatus getInstruction(MCInst &Instr, uint64_t &Size, ArrayRef< uint8_t > Bytes, uint64_t Address, raw_ostream &CStream) const =0
Returns the disassembly of a single instruction.
Instances of this class represent a single low-level machine instruction.
unsigned getNumOperands() const
SmallVectorImpl< MCOperand >::iterator iterator
unsigned getOpcode() const
void addOperand(const MCOperand Op)
void setOpcode(unsigned Op)
const MCOperand & getOperand(unsigned i) const
Describe properties that are true of each instruction in the target description file.
ArrayRef< MCOperandInfo > operands() const
unsigned short NumOperands
int getOperandConstraint(unsigned OpNum, MCOI::OperandConstraint Constraint) const
Returns the value of the specified operand constraint if it is present.
bool isPredicable() const
Return true if this instruction has a predicate operand that controls execution.
Interface to description of machine instruction set.
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode.
Instances of this class represent operands of the MCInst class.
static MCOperand createReg(MCRegister Reg)
static MCOperand createImm(int64_t Val)
MCRegister getReg() const
Returns the register number.
Wrapper class representing physical registers. Should be passed by value.
Generic base class for all target subtargets.
bool hasFeature(unsigned Feature) const
const FeatureBitset & getFeatureBits() const
Wrapper class representing virtual and physical registers.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Target - Wrapper for Target specific information.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
unsigned getAM2Opc(AddrOpc Opc, unsigned Imm12, ShiftOpc SO, unsigned IdxMode=0)
unsigned getAM5Opc(AddrOpc Opc, unsigned char Offset)
getAM5Opc - This function encodes the addrmode5 opc field.
unsigned getAM5FP16Opc(AddrOpc Opc, unsigned char Offset)
getAM5FP16Opc - This function encodes the addrmode5fp16 opc field.
bool isVpred(OperandType op)
bool isCDECoproc(size_t Coproc, const MCSubtargetInfo &STI)
@ D16
Only 16 D registers.
constexpr std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
std::enable_if_t< std::is_integral_v< IntType >, IntType > fieldFromInstruction(const IntType &Insn, unsigned StartBit, unsigned NumBits)
This is an optimization pass for GlobalISel generic memory operations.
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
Target & getTheThumbBETarget()
static bool isVPTOpcode(int Opc)
constexpr bool isPowerOf2_32(uint32_t Value)
Return true if the argument is a power of two > 0.
static bool isValidCoprocessorNumber(unsigned Num, const FeatureBitset &featureBits)
isValidCoprocessorNumber - decide whether an explicit coprocessor number is legal in generic instruct...
Target & getTheARMLETarget()
Target & getTheARMBETarget()
Target & getTheThumbLETarget()
static void RegisterMCDisassembler(Target &T, Target::MCDisassemblerCtorTy Fn)
RegisterMCDisassembler - Register a MCDisassembler implementation for the given target.