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!");
1022 ARM::R0, ARM::R1, ARM::R2, ARM::R3,
1023 ARM::R4, ARM::R5, ARM::R6, ARM::R7,
1024 ARM::R8, ARM::R9, ARM::R10, ARM::R11,
1025 ARM::R12, ARM::SP, ARM::LR, ARM::PC
1029 ARM::R0, ARM::R1, ARM::R2, ARM::R3,
1030 ARM::R4, ARM::R5, ARM::R6, ARM::R7,
1031 ARM::R8, ARM::R9, ARM::R10, ARM::R11,
1032 ARM::R12, 0, ARM::LR, ARM::APSR
1138 ARM::R0_R1, ARM::R2_R3, ARM::R4_R5, ARM::R6_R7,
1139 ARM::R8_R9, ARM::R10_R11, ARM::R12_SP
1169 if ((RegNo & 1) || RegNo > 10)
1224 if ((RegNo == 13 && !featureBits[ARM::HasV8Ops]) || RegNo == 15)
1232 ARM::S0, ARM::S1, ARM::S2, ARM::S3,
1233 ARM::S4, ARM::S5, ARM::S6, ARM::S7,
1234 ARM::S8, ARM::S9, ARM::S10, ARM::S11,
1235 ARM::S12, ARM::S13, ARM::S14, ARM::S15,
1236 ARM::S16, ARM::S17, ARM::S18, ARM::S19,
1237 ARM::S20, ARM::S21, ARM::S22, ARM::S23,
1238 ARM::S24, ARM::S25, ARM::S26, ARM::S27,
1239 ARM::S28, ARM::S29, ARM::S30, ARM::S31
1260 ARM::D0, ARM::D1, ARM::D2, ARM::D3,
1261 ARM::D4, ARM::D5, ARM::D6, ARM::D7,
1262 ARM::D8, ARM::D9, ARM::D10, ARM::D11,
1263 ARM::D12, ARM::D13, ARM::D14, ARM::D15,
1264 ARM::D16, ARM::D17, ARM::D18, ARM::D19,
1265 ARM::D20, ARM::D21, ARM::D22, ARM::D23,
1266 ARM::D24, ARM::D25, ARM::D26, ARM::D27,
1267 ARM::D28, ARM::D29, ARM::D30, ARM::D31
1276 return featureBits[ARM::FeatureD32];
1282 if (RegNo > (
PermitsD32(Inst, Decoder) ? 31u : 15u))
1315 ARM::Q0, ARM::Q1, ARM::Q2, ARM::Q3,
1316 ARM::Q4, ARM::Q5, ARM::Q6, ARM::Q7,
1317 ARM::Q8, ARM::Q9, ARM::Q10, ARM::Q11,
1318 ARM::Q12, ARM::Q13, ARM::Q14, ARM::Q15
1324 if (RegNo > 31 || (RegNo & 1) != 0)
1334 ARM::Q0, ARM::D1_D2, ARM::Q1, ARM::D3_D4, ARM::Q2, ARM::D5_D6,
1335 ARM::Q3, ARM::D7_D8, ARM::Q4, ARM::D9_D10, ARM::Q5, ARM::D11_D12,
1336 ARM::Q6, ARM::D13_D14, ARM::Q7, ARM::D15_D16, ARM::Q8, ARM::D17_D18,
1337 ARM::Q9, ARM::D19_D20, ARM::Q10, ARM::D21_D22, ARM::Q11, ARM::D23_D24,
1338 ARM::Q12, ARM::D25_D26, ARM::Q13, ARM::D27_D28, ARM::Q14, ARM::D29_D30,
1354 ARM::D0_D2, ARM::D1_D3, ARM::D2_D4, ARM::D3_D5,
1355 ARM::D4_D6, ARM::D5_D7, ARM::D6_D8, ARM::D7_D9,
1356 ARM::D8_D10, ARM::D9_D11, ARM::D10_D12, ARM::D11_D13,
1357 ARM::D12_D14, ARM::D13_D15, ARM::D14_D16, ARM::D15_D17,
1358 ARM::D16_D18, ARM::D17_D19, ARM::D18_D20, ARM::D19_D21,
1359 ARM::D20_D22, ARM::D21_D23, ARM::D22_D24, ARM::D23_D25,
1360 ARM::D24_D26, ARM::D25_D27, ARM::D26_D28, ARM::D27_D29,
1361 ARM::D28_D30, ARM::D29_D31
1381 if (Inst.
getOpcode() == ARM::tBcc && Val == 0xE)
1384 static_cast<const ARMDisassembler *
>(Decoder)->MCII.
get();
1437 unsigned Op = Shift | (imm << 3);
1484 bool NeedDisjointWriteback =
false;
1490 case ARM::LDMIA_UPD:
1491 case ARM::LDMDB_UPD:
1492 case ARM::LDMIB_UPD:
1493 case ARM::LDMDA_UPD:
1494 case ARM::t2LDMIA_UPD:
1495 case ARM::t2LDMDB_UPD:
1496 case ARM::t2STMIA_UPD:
1497 case ARM::t2STMDB_UPD:
1498 NeedDisjointWriteback =
true;
1508 for (
unsigned i = 0; i < 16; ++i) {
1509 if (Val & (1 << i)) {
1518 if (NeedDisjointWriteback && WritebackReg == Inst.
end()[-1].getReg())
1536 if (regs == 0 || (Vd + regs) > 32) {
1537 regs = Vd + regs > 32 ? 32 - Vd : regs;
1538 regs = std::max( 1u, regs);
1544 for (
unsigned i = 0; i < (regs - 1); ++i) {
1561 unsigned MaxReg =
PermitsD32(Inst, Decoder) ? 32 : 16;
1562 if (regs == 0 || (Vd + regs) > MaxReg) {
1563 regs = Vd + regs > MaxReg ? MaxReg - Vd : regs;
1564 regs = std::max( 1u, regs);
1565 regs = std::min(MaxReg, regs);
1571 for (
unsigned i = 0; i < (regs - 1); ++i) {
1600 if (msb != 31) msb_mask = (1U << (msb+1)) - 1;
1601 uint32_t lsb_mask = (1U << lsb) - 1;
1622 case ARM::LDC_OFFSET:
1625 case ARM::LDC_OPTION:
1626 case ARM::LDCL_OFFSET:
1628 case ARM::LDCL_POST:
1629 case ARM::LDCL_OPTION:
1630 case ARM::STC_OFFSET:
1633 case ARM::STC_OPTION:
1634 case ARM::STCL_OFFSET:
1636 case ARM::STCL_POST:
1637 case ARM::STCL_OPTION:
1638 case ARM::t2LDC_OFFSET:
1639 case ARM::t2LDC_PRE:
1640 case ARM::t2LDC_POST:
1641 case ARM::t2LDC_OPTION:
1642 case ARM::t2LDCL_OFFSET:
1643 case ARM::t2LDCL_PRE:
1644 case ARM::t2LDCL_POST:
1645 case ARM::t2LDCL_OPTION:
1646 case ARM::t2STC_OFFSET:
1647 case ARM::t2STC_PRE:
1648 case ARM::t2STC_POST:
1649 case ARM::t2STC_OPTION:
1650 case ARM::t2STCL_OFFSET:
1651 case ARM::t2STCL_PRE:
1652 case ARM::t2STCL_POST:
1653 case ARM::t2STCL_OPTION:
1654 case ARM::t2LDC2_OFFSET:
1655 case ARM::t2LDC2L_OFFSET:
1656 case ARM::t2LDC2_PRE:
1657 case ARM::t2LDC2L_PRE:
1658 case ARM::t2STC2_OFFSET:
1659 case ARM::t2STC2L_OFFSET:
1660 case ARM::t2STC2_PRE:
1661 case ARM::t2STC2L_PRE:
1662 case ARM::LDC2_OFFSET:
1663 case ARM::LDC2L_OFFSET:
1665 case ARM::LDC2L_PRE:
1666 case ARM::STC2_OFFSET:
1667 case ARM::STC2L_OFFSET:
1669 case ARM::STC2L_PRE:
1670 case ARM::t2LDC2_OPTION:
1671 case ARM::t2STC2_OPTION:
1672 case ARM::t2LDC2_POST:
1673 case ARM::t2LDC2L_POST:
1674 case ARM::t2STC2_POST:
1675 case ARM::t2STC2L_POST:
1676 case ARM::LDC2_POST:
1677 case ARM::LDC2L_POST:
1678 case ARM::STC2_POST:
1679 case ARM::STC2L_POST:
1680 if (coproc == 0xA || coproc == 0xB ||
1681 (featureBits[ARM::HasV8_1MMainlineOps] &&
1682 (coproc == 0x8 || coproc == 0x9 || coproc == 0xA || coproc == 0xB ||
1683 coproc == 0xE || coproc == 0xF)))
1690 if (featureBits[ARM::HasV8Ops] && (coproc != 14))
1699 case ARM::t2LDC2_OFFSET:
1700 case ARM::t2LDC2L_OFFSET:
1701 case ARM::t2LDC2_PRE:
1702 case ARM::t2LDC2L_PRE:
1703 case ARM::t2STC2_OFFSET:
1704 case ARM::t2STC2L_OFFSET:
1705 case ARM::t2STC2_PRE:
1706 case ARM::t2STC2L_PRE:
1707 case ARM::LDC2_OFFSET:
1708 case ARM::LDC2L_OFFSET:
1710 case ARM::LDC2L_PRE:
1711 case ARM::STC2_OFFSET:
1712 case ARM::STC2L_OFFSET:
1714 case ARM::STC2L_PRE:
1715 case ARM::t2LDC_OFFSET:
1716 case ARM::t2LDCL_OFFSET:
1717 case ARM::t2LDC_PRE:
1718 case ARM::t2LDCL_PRE:
1719 case ARM::t2STC_OFFSET:
1720 case ARM::t2STCL_OFFSET:
1721 case ARM::t2STC_PRE:
1722 case ARM::t2STCL_PRE:
1723 case ARM::LDC_OFFSET:
1724 case ARM::LDCL_OFFSET:
1727 case ARM::STC_OFFSET:
1728 case ARM::STCL_OFFSET:
1734 case ARM::t2LDC2_POST:
1735 case ARM::t2LDC2L_POST:
1736 case ARM::t2STC2_POST:
1737 case ARM::t2STC2L_POST:
1738 case ARM::LDC2_POST:
1739 case ARM::LDC2L_POST:
1740 case ARM::STC2_POST:
1741 case ARM::STC2L_POST:
1742 case ARM::t2LDC_POST:
1743 case ARM::t2LDCL_POST:
1744 case ARM::t2STC_POST:
1745 case ARM::t2STCL_POST:
1747 case ARM::LDCL_POST:
1749 case ARM::STCL_POST:
1760 case ARM::LDC_OFFSET:
1763 case ARM::LDC_OPTION:
1764 case ARM::LDCL_OFFSET:
1766 case ARM::LDCL_POST:
1767 case ARM::LDCL_OPTION:
1768 case ARM::STC_OFFSET:
1771 case ARM::STC_OPTION:
1772 case ARM::STCL_OFFSET:
1774 case ARM::STCL_POST:
1775 case ARM::STCL_OPTION:
1802 case ARM::STR_POST_IMM:
1803 case ARM::STR_POST_REG:
1804 case ARM::STRB_POST_IMM:
1805 case ARM::STRB_POST_REG:
1806 case ARM::STRT_POST_REG:
1807 case ARM::STRT_POST_IMM:
1808 case ARM::STRBT_POST_REG:
1809 case ARM::STRBT_POST_IMM:
1822 case ARM::LDR_POST_IMM:
1823 case ARM::LDR_POST_REG:
1824 case ARM::LDRB_POST_IMM:
1825 case ARM::LDRB_POST_REG:
1826 case ARM::LDRBT_POST_REG:
1827 case ARM::LDRBT_POST_IMM:
1828 case ARM::LDRT_POST_REG:
1829 case ARM::LDRT_POST_IMM:
1844 bool writeback = (
P == 0) || (W == 1);
1845 unsigned idx_mode = 0;
1848 else if (!
P && writeback)
1851 if (writeback && (Rn == 15 || Rn == Rt))
1959 unsigned U = ((~fieldFromInstruction(Insn, 23, 1)) & 1) << 8;
1963 unsigned Rt2 = Rt + 1;
1965 bool writeback = (W == 1) | (
P == 0);
1971 case ARM::STRD_POST:
1974 case ARM::LDRD_POST:
1983 case ARM::STRD_POST:
1984 if (
P == 0 && W == 1)
1987 if (writeback && (Rn == 15 || Rn == Rt || Rn == Rt2))
1989 if (type && Rm == 15)
1998 case ARM::STRH_POST:
2001 if (writeback && (Rn == 15 || Rn == Rt))
2003 if (!type && Rm == 15)
2008 case ARM::LDRD_POST:
2009 if (type && Rn == 15) {
2014 if (
P == 0 && W == 1)
2016 if (!type && (Rt2 == 15 || Rm == 15 || Rm == Rt || Rm == Rt2))
2018 if (!type && writeback && Rn == 15)
2020 if (writeback && (Rn == Rt || Rn == Rt2))
2025 case ARM::LDRH_POST:
2026 if (type && Rn == 15) {
2033 if (!type && Rm == 15)
2035 if (!type && writeback && (Rn == 15 || Rn == Rt))
2039 case ARM::LDRSH_PRE:
2040 case ARM::LDRSH_POST:
2042 case ARM::LDRSB_PRE:
2043 case ARM::LDRSB_POST:
2044 if (type && Rn == 15) {
2049 if (type && (Rt == 15 || (writeback && Rn == Rt)))
2051 if (!type && (Rt == 15 || Rm == 15))
2053 if (!type && writeback && (Rn == 15 || Rn == Rt))
2070 case ARM::STRD_POST:
2073 case ARM::STRH_POST:
2087 case ARM::STRD_POST:
2090 case ARM::LDRD_POST:
2103 case ARM::LDRD_POST:
2106 case ARM::LDRH_POST:
2108 case ARM::LDRSH_PRE:
2109 case ARM::LDRSH_POST:
2111 case ARM::LDRSB_PRE:
2112 case ARM::LDRSB_POST:
2211 case ARM::LDMDA_UPD:
2217 case ARM::LDMDB_UPD:
2223 case ARM::LDMIA_UPD:
2229 case ARM::LDMIB_UPD:
2235 case ARM::STMDA_UPD:
2241 case ARM::STMDB_UPD:
2247 case ARM::STMIA_UPD:
2253 case ARM::STMIB_UPD:
2305 if (imm8 == 0x10 && pred != 0xe && ((FeatureBits[ARM::FeatureRAS]) != 0))
2340 }
else if (imod && !M) {
2345 }
else if (!imod && M) {
2381 }
else if (imod && !M) {
2386 }
else if (!imod && M) {
2407 unsigned Opcode = ARM::t2HINT;
2410 Opcode = ARM::t2PACBTI;
2411 }
else if (imm == 0x1D) {
2412 Opcode = ARM::t2PAC;
2413 }
else if (imm == 0x2D) {
2414 Opcode = ARM::t2AUT;
2415 }
else if (imm == 0x0F) {
2416 Opcode = ARM::t2BTI;
2420 if (Opcode == ARM::t2HINT) {
2541 if (!FeatureBits[ARM::HasV8_1aOps] ||
2542 !FeatureBits[ARM::HasV8Ops])
2572 if (!add) imm *= -1;
2573 if (imm == 0 && !add) imm = INT32_MIN;
2643 unsigned I1 = !(J1 ^ S);
2644 unsigned I2 = !(J2 ^ S);
2647 unsigned tmp = (S << 23) | (I1 << 22) | (I2 << 21) | (imm10 << 11) | imm11;
2648 int imm32 = SignExtend32<25>(tmp << 1);
2650 true, 4, Inst, Decoder))
2668 true, 4, Inst, Decoder))
2674 true, 4, Inst, Decoder))
2718 case ARM::VLD1q16:
case ARM::VLD1q32:
case ARM::VLD1q64:
case ARM::VLD1q8:
2719 case ARM::VLD1q16wb_fixed:
case ARM::VLD1q16wb_register:
2720 case ARM::VLD1q32wb_fixed:
case ARM::VLD1q32wb_register:
2721 case ARM::VLD1q64wb_fixed:
case ARM::VLD1q64wb_register:
2722 case ARM::VLD1q8wb_fixed:
case ARM::VLD1q8wb_register:
2723 case ARM::VLD2d16:
case ARM::VLD2d32:
case ARM::VLD2d8:
2724 case ARM::VLD2d16wb_fixed:
case ARM::VLD2d16wb_register:
2725 case ARM::VLD2d32wb_fixed:
case ARM::VLD2d32wb_register:
2726 case ARM::VLD2d8wb_fixed:
case ARM::VLD2d8wb_register:
2733 case ARM::VLD2b16wb_fixed:
2734 case ARM::VLD2b16wb_register:
2735 case ARM::VLD2b32wb_fixed:
2736 case ARM::VLD2b32wb_register:
2737 case ARM::VLD2b8wb_fixed:
2738 case ARM::VLD2b8wb_register:
2752 case ARM::VLD3d8_UPD:
2753 case ARM::VLD3d16_UPD:
2754 case ARM::VLD3d32_UPD:
2758 case ARM::VLD4d8_UPD:
2759 case ARM::VLD4d16_UPD:
2760 case ARM::VLD4d32_UPD:
2767 case ARM::VLD3q8_UPD:
2768 case ARM::VLD3q16_UPD:
2769 case ARM::VLD3q32_UPD:
2773 case ARM::VLD4q8_UPD:
2774 case ARM::VLD4q16_UPD:
2775 case ARM::VLD4q32_UPD:
2788 case ARM::VLD3d8_UPD:
2789 case ARM::VLD3d16_UPD:
2790 case ARM::VLD3d32_UPD:
2794 case ARM::VLD4d8_UPD:
2795 case ARM::VLD4d16_UPD:
2796 case ARM::VLD4d32_UPD:
2803 case ARM::VLD3q8_UPD:
2804 case ARM::VLD3q16_UPD:
2805 case ARM::VLD3q32_UPD:
2809 case ARM::VLD4q8_UPD:
2810 case ARM::VLD4q16_UPD:
2811 case ARM::VLD4q32_UPD:
2824 case ARM::VLD4d8_UPD:
2825 case ARM::VLD4d16_UPD:
2826 case ARM::VLD4d32_UPD:
2833 case ARM::VLD4q8_UPD:
2834 case ARM::VLD4q16_UPD:
2835 case ARM::VLD4q32_UPD:
2845 case ARM::VLD1d8wb_fixed:
2846 case ARM::VLD1d16wb_fixed:
2847 case ARM::VLD1d32wb_fixed:
2848 case ARM::VLD1d64wb_fixed:
2849 case ARM::VLD1d8wb_register:
2850 case ARM::VLD1d16wb_register:
2851 case ARM::VLD1d32wb_register:
2852 case ARM::VLD1d64wb_register:
2853 case ARM::VLD1q8wb_fixed:
2854 case ARM::VLD1q16wb_fixed:
2855 case ARM::VLD1q32wb_fixed:
2856 case ARM::VLD1q64wb_fixed:
2857 case ARM::VLD1q8wb_register:
2858 case ARM::VLD1q16wb_register:
2859 case ARM::VLD1q32wb_register:
2860 case ARM::VLD1q64wb_register:
2861 case ARM::VLD1d8Twb_fixed:
2862 case ARM::VLD1d8Twb_register:
2863 case ARM::VLD1d16Twb_fixed:
2864 case ARM::VLD1d16Twb_register:
2865 case ARM::VLD1d32Twb_fixed:
2866 case ARM::VLD1d32Twb_register:
2867 case ARM::VLD1d64Twb_fixed:
2868 case ARM::VLD1d64Twb_register:
2869 case ARM::VLD1d8Qwb_fixed:
2870 case ARM::VLD1d8Qwb_register:
2871 case ARM::VLD1d16Qwb_fixed:
2872 case ARM::VLD1d16Qwb_register:
2873 case ARM::VLD1d32Qwb_fixed:
2874 case ARM::VLD1d32Qwb_register:
2875 case ARM::VLD1d64Qwb_fixed:
2876 case ARM::VLD1d64Qwb_register:
2877 case ARM::VLD2d8wb_fixed:
2878 case ARM::VLD2d16wb_fixed:
2879 case ARM::VLD2d32wb_fixed:
2880 case ARM::VLD2q8wb_fixed:
2881 case ARM::VLD2q16wb_fixed:
2882 case ARM::VLD2q32wb_fixed:
2883 case ARM::VLD2d8wb_register:
2884 case ARM::VLD2d16wb_register:
2885 case ARM::VLD2d32wb_register:
2886 case ARM::VLD2q8wb_register:
2887 case ARM::VLD2q16wb_register:
2888 case ARM::VLD2q32wb_register:
2889 case ARM::VLD2b8wb_fixed:
2890 case ARM::VLD2b16wb_fixed:
2891 case ARM::VLD2b32wb_fixed:
2892 case ARM::VLD2b8wb_register:
2893 case ARM::VLD2b16wb_register:
2894 case ARM::VLD2b32wb_register:
2897 case ARM::VLD3d8_UPD:
2898 case ARM::VLD3d16_UPD:
2899 case ARM::VLD3d32_UPD:
2900 case ARM::VLD3q8_UPD:
2901 case ARM::VLD3q16_UPD:
2902 case ARM::VLD3q32_UPD:
2903 case ARM::VLD4d8_UPD:
2904 case ARM::VLD4d16_UPD:
2905 case ARM::VLD4d32_UPD:
2906 case ARM::VLD4q8_UPD:
2907 case ARM::VLD4q16_UPD:
2908 case ARM::VLD4q32_UPD:
2935 case ARM::VLD1d8wb_fixed:
2936 case ARM::VLD1d16wb_fixed:
2937 case ARM::VLD1d32wb_fixed:
2938 case ARM::VLD1d64wb_fixed:
2939 case ARM::VLD1d8Twb_fixed:
2940 case ARM::VLD1d16Twb_fixed:
2941 case ARM::VLD1d32Twb_fixed:
2942 case ARM::VLD1d64Twb_fixed:
2943 case ARM::VLD1d8Qwb_fixed:
2944 case ARM::VLD1d16Qwb_fixed:
2945 case ARM::VLD1d32Qwb_fixed:
2946 case ARM::VLD1d64Qwb_fixed:
2947 case ARM::VLD1d8wb_register:
2948 case ARM::VLD1d16wb_register:
2949 case ARM::VLD1d32wb_register:
2950 case ARM::VLD1d64wb_register:
2951 case ARM::VLD1q8wb_fixed:
2952 case ARM::VLD1q16wb_fixed:
2953 case ARM::VLD1q32wb_fixed:
2954 case ARM::VLD1q64wb_fixed:
2955 case ARM::VLD1q8wb_register:
2956 case ARM::VLD1q16wb_register:
2957 case ARM::VLD1q32wb_register:
2958 case ARM::VLD1q64wb_register:
2962 if (Rm != 0xD && Rm != 0xF &&
2966 case ARM::VLD2d8wb_fixed:
2967 case ARM::VLD2d16wb_fixed:
2968 case ARM::VLD2d32wb_fixed:
2969 case ARM::VLD2b8wb_fixed:
2970 case ARM::VLD2b16wb_fixed:
2971 case ARM::VLD2b32wb_fixed:
2972 case ARM::VLD2q8wb_fixed:
2973 case ARM::VLD2q16wb_fixed:
2974 case ARM::VLD2q32wb_fixed:
3050 case ARM::VST1d8wb_fixed:
3051 case ARM::VST1d16wb_fixed:
3052 case ARM::VST1d32wb_fixed:
3053 case ARM::VST1d64wb_fixed:
3054 case ARM::VST1d8wb_register:
3055 case ARM::VST1d16wb_register:
3056 case ARM::VST1d32wb_register:
3057 case ARM::VST1d64wb_register:
3058 case ARM::VST1q8wb_fixed:
3059 case ARM::VST1q16wb_fixed:
3060 case ARM::VST1q32wb_fixed:
3061 case ARM::VST1q64wb_fixed:
3062 case ARM::VST1q8wb_register:
3063 case ARM::VST1q16wb_register:
3064 case ARM::VST1q32wb_register:
3065 case ARM::VST1q64wb_register:
3066 case ARM::VST1d8Twb_fixed:
3067 case ARM::VST1d16Twb_fixed:
3068 case ARM::VST1d32Twb_fixed:
3069 case ARM::VST1d64Twb_fixed:
3070 case ARM::VST1d8Twb_register:
3071 case ARM::VST1d16Twb_register:
3072 case ARM::VST1d32Twb_register:
3073 case ARM::VST1d64Twb_register:
3074 case ARM::VST1d8Qwb_fixed:
3075 case ARM::VST1d16Qwb_fixed:
3076 case ARM::VST1d32Qwb_fixed:
3077 case ARM::VST1d64Qwb_fixed:
3078 case ARM::VST1d8Qwb_register:
3079 case ARM::VST1d16Qwb_register:
3080 case ARM::VST1d32Qwb_register:
3081 case ARM::VST1d64Qwb_register:
3082 case ARM::VST2d8wb_fixed:
3083 case ARM::VST2d16wb_fixed:
3084 case ARM::VST2d32wb_fixed:
3085 case ARM::VST2d8wb_register:
3086 case ARM::VST2d16wb_register:
3087 case ARM::VST2d32wb_register:
3088 case ARM::VST2q8wb_fixed:
3089 case ARM::VST2q16wb_fixed:
3090 case ARM::VST2q32wb_fixed:
3091 case ARM::VST2q8wb_register:
3092 case ARM::VST2q16wb_register:
3093 case ARM::VST2q32wb_register:
3094 case ARM::VST2b8wb_fixed:
3095 case ARM::VST2b16wb_fixed:
3096 case ARM::VST2b32wb_fixed:
3097 case ARM::VST2b8wb_register:
3098 case ARM::VST2b16wb_register:
3099 case ARM::VST2b32wb_register:
3104 case ARM::VST3d8_UPD:
3105 case ARM::VST3d16_UPD:
3106 case ARM::VST3d32_UPD:
3107 case ARM::VST3q8_UPD:
3108 case ARM::VST3q16_UPD:
3109 case ARM::VST3q32_UPD:
3110 case ARM::VST4d8_UPD:
3111 case ARM::VST4d16_UPD:
3112 case ARM::VST4d32_UPD:
3113 case ARM::VST4q8_UPD:
3114 case ARM::VST4q16_UPD:
3115 case ARM::VST4q32_UPD:
3132 else if (Rm != 0xF) {
3137 case ARM::VST1d8wb_fixed:
3138 case ARM::VST1d16wb_fixed:
3139 case ARM::VST1d32wb_fixed:
3140 case ARM::VST1d64wb_fixed:
3141 case ARM::VST1q8wb_fixed:
3142 case ARM::VST1q16wb_fixed:
3143 case ARM::VST1q32wb_fixed:
3144 case ARM::VST1q64wb_fixed:
3145 case ARM::VST1d8Twb_fixed:
3146 case ARM::VST1d16Twb_fixed:
3147 case ARM::VST1d32Twb_fixed:
3148 case ARM::VST1d64Twb_fixed:
3149 case ARM::VST1d8Qwb_fixed:
3150 case ARM::VST1d16Qwb_fixed:
3151 case ARM::VST1d32Qwb_fixed:
3152 case ARM::VST1d64Qwb_fixed:
3153 case ARM::VST2d8wb_fixed:
3154 case ARM::VST2d16wb_fixed:
3155 case ARM::VST2d32wb_fixed:
3156 case ARM::VST2q8wb_fixed:
3157 case ARM::VST2q16wb_fixed:
3158 case ARM::VST2q32wb_fixed:
3159 case ARM::VST2b8wb_fixed:
3160 case ARM::VST2b16wb_fixed:
3161 case ARM::VST2b32wb_fixed:
3171 case ARM::VST1q16wb_fixed:
3172 case ARM::VST1q16wb_register:
3173 case ARM::VST1q32wb_fixed:
3174 case ARM::VST1q32wb_register:
3175 case ARM::VST1q64wb_fixed:
3176 case ARM::VST1q64wb_register:
3177 case ARM::VST1q8wb_fixed:
3178 case ARM::VST1q8wb_register:
3182 case ARM::VST2d16wb_fixed:
3183 case ARM::VST2d16wb_register:
3184 case ARM::VST2d32wb_fixed:
3185 case ARM::VST2d32wb_register:
3186 case ARM::VST2d8wb_fixed:
3187 case ARM::VST2d8wb_register:
3194 case ARM::VST2b16wb_fixed:
3195 case ARM::VST2b16wb_register:
3196 case ARM::VST2b32wb_fixed:
3197 case ARM::VST2b32wb_register:
3198 case ARM::VST2b8wb_fixed:
3199 case ARM::VST2b8wb_register:
3213 case ARM::VST3d8_UPD:
3214 case ARM::VST3d16_UPD:
3215 case ARM::VST3d32_UPD:
3219 case ARM::VST4d8_UPD:
3220 case ARM::VST4d16_UPD:
3221 case ARM::VST4d32_UPD:
3228 case ARM::VST3q8_UPD:
3229 case ARM::VST3q16_UPD:
3230 case ARM::VST3q32_UPD:
3234 case ARM::VST4q8_UPD:
3235 case ARM::VST4q16_UPD:
3236 case ARM::VST4q32_UPD:
3249 case ARM::VST3d8_UPD:
3250 case ARM::VST3d16_UPD:
3251 case ARM::VST3d32_UPD:
3255 case ARM::VST4d8_UPD:
3256 case ARM::VST4d16_UPD:
3257 case ARM::VST4d32_UPD:
3264 case ARM::VST3q8_UPD:
3265 case ARM::VST3q16_UPD:
3266 case ARM::VST3q32_UPD:
3270 case ARM::VST4q8_UPD:
3271 case ARM::VST4q16_UPD:
3272 case ARM::VST4q32_UPD:
3285 case ARM::VST4d8_UPD:
3286 case ARM::VST4d16_UPD:
3287 case ARM::VST4d32_UPD:
3294 case ARM::VST4q8_UPD:
3295 case ARM::VST4q16_UPD:
3296 case ARM::VST4q32_UPD:
3319 if (
size == 0 && align == 1)
3321 align *= (1 <<
size);
3324 case ARM::VLD1DUPq16:
case ARM::VLD1DUPq32:
case ARM::VLD1DUPq8:
3325 case ARM::VLD1DUPq16wb_fixed:
case ARM::VLD1DUPq16wb_register:
3326 case ARM::VLD1DUPq32wb_fixed:
case ARM::VLD1DUPq32wb_register:
3327 case ARM::VLD1DUPq8wb_fixed:
case ARM::VLD1DUPq8wb_register:
3348 if (Rm != 0xD && Rm != 0xF &&
3369 case ARM::VLD2DUPd16:
case ARM::VLD2DUPd32:
case ARM::VLD2DUPd8:
3370 case ARM::VLD2DUPd16wb_fixed:
case ARM::VLD2DUPd16wb_register:
3371 case ARM::VLD2DUPd32wb_fixed:
case ARM::VLD2DUPd32wb_register:
3372 case ARM::VLD2DUPd8wb_fixed:
case ARM::VLD2DUPd8wb_register:
3376 case ARM::VLD2DUPd16x2:
case ARM::VLD2DUPd32x2:
case ARM::VLD2DUPd8x2:
3377 case ARM::VLD2DUPd16x2wb_fixed:
case ARM::VLD2DUPd16x2wb_register:
3378 case ARM::VLD2DUPd32x2wb_fixed:
case ARM::VLD2DUPd32x2wb_register:
3379 case ARM::VLD2DUPd8x2wb_fixed:
case ARM::VLD2DUPd8x2wb_register:
3396 if (Rm != 0xD && Rm != 0xF) {
3432 else if (Rm != 0xF) {
3485 else if (Rm != 0xF) {
3518 case ARM::VORRiv4i16:
3519 case ARM::VORRiv2i32:
3520 case ARM::VBICiv4i16:
3521 case ARM::VBICiv2i32:
3525 case ARM::VORRiv8i16:
3526 case ARM::VORRiv4i32:
3527 case ARM::VBICiv8i16:
3528 case ARM::VBICiv4i32:
3553 if (cmode == 0xF && Inst.
getOpcode() == ARM::MVE_VMVNimmi32)
3708 true, 2, Inst, Decoder))
3717 true, 4, Inst, Decoder))
3726 true, 2, Inst, Decoder))
3765 unsigned imm = Val << 2;
3823 bool hasMP = featureBits[ARM::FeatureMP];
3824 bool hasV7Ops = featureBits[ARM::HasV7Ops];
3879 if (!hasV7Ops || !hasMP)
3912 bool hasMP = featureBits[ARM::FeatureMP];
3913 bool hasV7Ops = featureBits[ARM::HasV7Ops];
3923 case ARM::t2LDRSBi8:
3929 case ARM::t2LDRSHi8:
3946 case ARM::t2LDRSHi8:
3952 case ARM::t2LDRSBi8:
3968 if (!hasV7Ops || !hasMP)
3994 bool hasMP = featureBits[ARM::FeatureMP];
3995 bool hasV7Ops = featureBits[ARM::HasV7Ops];
4002 case ARM::t2LDRHi12:
4005 case ARM::t2LDRSHi12:
4008 case ARM::t2LDRBi12:
4011 case ARM::t2LDRSBi12:
4028 case ARM::t2LDRSHi12:
4030 case ARM::t2LDRHi12:
4033 case ARM::t2LDRSBi12:
4048 case ARM::t2PLDWi12:
4049 if (!hasV7Ops || !hasMP)
4113 bool hasV7Ops = featureBits[ARM::HasV7Ops];
4117 case ARM::t2LDRBpci:
4118 case ARM::t2LDRHpci:
4121 case ARM::t2LDRSBpci:
4124 case ARM::t2LDRSHpci:
4160 int imm = Val & 0xFF;
4162 if (!(Val & 0x100)) imm *= -1;
4174 int imm = Val & 0x7F;
4234 int imm = Val & 0xFF;
4237 else if (!(Val & 0x100))
4247 int imm = Val & 0x7F;
4250 else if (!(Val & 0x80))
4252 if (imm != INT32_MIN)
4253 imm *= (1U << shift);
4317 if (!
Check(S, DecodeT2Imm7<shift>(Inst, imm,
Address, Decoder)))
4323template <
int shift,
int WriteBack>
4336 if (!
Check(S, DecodeT2Imm7<shift>(Inst, imm,
Address, Decoder)))
4356 case ARM::t2LDR_PRE:
4357 case ARM::t2LDR_POST:
4360 case ARM::t2LDRB_PRE:
4361 case ARM::t2LDRB_POST:
4364 case ARM::t2LDRH_PRE:
4365 case ARM::t2LDRH_POST:
4368 case ARM::t2LDRSB_PRE:
4369 case ARM::t2LDRSB_POST:
4375 case ARM::t2LDRSH_PRE:
4376 case ARM::t2LDRSH_POST:
4415 case ARM::t2STRBi12:
4416 case ARM::t2STRHi12:
4457 }
else if (Inst.
getOpcode() == ARM::tADDspr) {
4527 if (imm != INT32_MIN)
4528 imm *= (1U << shift);
4544 unsigned S = (Val >> 23) & 1;
4545 unsigned J1 = (Val >> 22) & 1;
4546 unsigned J2 = (Val >> 21) & 1;
4547 unsigned I1 = !(J1 ^ S);
4548 unsigned I2 = !(J2 ^ S);
4549 unsigned tmp = (Val & ~0x600000) | (I1 << 22) | (I2 << 21);
4550 int imm32 = SignExtend32<25>(tmp << 1);
4554 true, 4, Inst, Decoder))
4562 if (Val == 0xA || Val == 0xB)
4599 if (pred == 0xE || pred == 0xF) {
4660 unsigned imm = llvm::rotr<uint32_t>(unrot, rot);
4671 true, 2, Inst, Decoder))
4686 unsigned S = (Val >> 23) & 1;
4687 unsigned J1 = (Val >> 22) & 1;
4688 unsigned J2 = (Val >> 21) & 1;
4689 unsigned I1 = !(J1 ^ S);
4690 unsigned I2 = !(J2 ^ S);
4691 unsigned tmp = (Val & ~0x600000) | (I1 << 22) | (I2 << 21);
4692 int imm32 = SignExtend32<25>(tmp << 1);
4695 true, 4, Inst, Decoder))
4726 if (FeatureBits[ARM::FeatureMClass]) {
4727 unsigned ValLow = Val & 0xff;
4746 if (!(FeatureBits[ARM::HasV7Ops]))
4754 if (!(FeatureBits[ARM::HasV8MMainlineOps]))
4764 if (!(FeatureBits[ARM::Feature8MSecExt]))
4783 if (!(FeatureBits[ARM::FeaturePACBTI]))
4794 if (!(FeatureBits[ARM::HasV7Ops])) {
4807 if (Mask == 0 || (Mask != 2 && ValLow > 3) ||
4808 (!(FeatureBits[ARM::FeatureDSP]) && (Mask & 1)))
4830 if (!ARMBankedReg::lookupBankedRegByEncoding((R << 5) | SysM))
4872 if (Rn == 0xF || Rd == Rn || Rd == Rt || Rd == Rt+1)
5548 if (Rt == 0xF || Rt2 == 0xF || Rm == 0x1F)
5574 if (Rt == 0xF || Rt2 == 0xF || Rm == 0x1F)
5610 unsigned LowBit = mask & -mask;
5611 unsigned BitsAboveLowBit = 0xF & (-LowBit << 1);
5612 mask ^= BitsAboveLowBit;
5632 bool writeback = (W == 1) | (
P == 0);
5634 addr |= (U << 8) | (Rn << 9);
5636 if (writeback && (Rn == Rt || Rn == Rt2))
5669 bool writeback = (W == 1) | (
P == 0);
5671 addr |= (U << 8) | (Rn << 9);
5673 if (writeback && (Rn == Rt || Rn == Rt2))
5741 if (Rt == Rn || Rn == Rt2)
5760 bool hasFullFP16 = featureBits[ARM::FeatureFullFP16];
5773 if (!(imm & 0x38)) {
5819 bool hasFullFP16 = featureBits[ARM::FeatureFullFP16];
5832 if (!(imm & 0x38)) {
5891 if (!
Check(S, DestRegDecoder(Inst, Vd,
Address, Decoder)))
5893 if (!
Check(S, DestRegDecoder(Inst, Vd,
Address, Decoder)))
5895 if (!
Check(S, DestRegDecoder(Inst, Vn,
Address, Decoder)))
5945 if ((cop & ~0x1) == 0xa)
5990 case ARM::VMSR_FPSCR_NZCVQC:
6001 if (featureBits[ARM::ModeThumb] && !featureBits[ARM::HasV8Ops]) {
6002 if (Rt == 13 || Rt == 15)
6011 case ARM::VMRS_FPSCR_NZCVQC:
6019 if (featureBits[ARM::ModeThumb]) {
6031template <
bool isSigned,
bool isNeg,
bool zeroPermitted,
int size>
6036 if (Val == 0 && !zeroPermitted)
6041 DecVal = SignExtend32<size + 1>(Val << 1);
6043 DecVal = (Val << 1);
6056 Val = LocImm + (2 << Val);
6082 case ARM::t2LEUpdate:
6088 if (!
Check(S, DecodeBFLabelOperand<false, true, true, 11>(
6089 Inst, Imm,
Address, Decoder)))
6093 case ARM::MVE_WLSTP_8:
6094 case ARM::MVE_WLSTP_16:
6095 case ARM::MVE_WLSTP_32:
6096 case ARM::MVE_WLSTP_64:
6101 !
Check(S, DecodeBFLabelOperand<false, false, true, 11>(
6102 Inst, Imm,
Address, Decoder)))
6106 case ARM::MVE_DLSTP_8:
6107 case ARM::MVE_DLSTP_16:
6108 case ARM::MVE_DLSTP_32:
6109 case ARM::MVE_DLSTP_64:
6115 uint32_t CanonicalLCTP = 0xF00FE001, SBZMask = 0x00300FFE;
6116 if ((Insn & ~SBZMask) != CanonicalLCTP)
6118 if (Insn != CanonicalLCTP)
6150 if ((RegNo) + 1 > 11)
6196 }
else if (Inst.
getOpcode() == ARM::VSCCLRMD) {
6207 unsigned max_reg = Vd + regs;
6208 if (max_reg > 64 || (max_reg > 32 && (max_reg & 1)))
6210 unsigned max_sreg = std::min(32u, max_reg);
6211 unsigned max_dreg = std::min(32u, max_reg / 2);
6212 for (
unsigned i = Vd; i < max_sreg; ++i)
6215 for (
unsigned i = 16; i < max_dreg; ++i)
6236 ARM::Q0_Q1, ARM::Q1_Q2, ARM::Q2_Q3, ARM::Q3_Q4,
6237 ARM::Q4_Q5, ARM::Q5_Q6, ARM::Q6_Q7
6252 ARM::Q0_Q1_Q2_Q3, ARM::Q1_Q2_Q3_Q4, ARM::Q2_Q3_Q4_Q5,
6253 ARM::Q3_Q4_Q5_Q6, ARM::Q4_Q5_Q6_Q7
6277 unsigned CurBit = 0;
6278 for (
int i = 3; i >= 0; --i) {
6281 CurBit ^= (Val >> i) & 1U;
6284 Imm |= (CurBit << i);
6287 if ((Val & ~(~0U << i)) == 0) {
6333 switch (Val & 0x3) {
6394 unsigned DecodedVal = 64 - Val;
6397 case ARM::MVE_VCVTf16s16_fix:
6398 case ARM::MVE_VCVTs16f16_fix:
6399 case ARM::MVE_VCVTf16u16_fix:
6400 case ARM::MVE_VCVTu16f16_fix:
6401 if (DecodedVal > 16)
6404 case ARM::MVE_VCVTf32s32_fix:
6405 case ARM::MVE_VCVTs32f32_fix:
6406 case ARM::MVE_VCVTf32u32_fix:
6407 case ARM::MVE_VCVTu32f32_fix:
6408 if (DecodedVal > 32)
6420 case ARM::VSTR_P0_off:
6421 case ARM::VSTR_P0_pre:
6422 case ARM::VSTR_P0_post:
6423 case ARM::VLDR_P0_off:
6424 case ARM::VLDR_P0_pre:
6425 case ARM::VLDR_P0_post:
6427 case ARM::VSTR_FPSCR_NZCVQC_off:
6428 case ARM::VSTR_FPSCR_NZCVQC_pre:
6429 case ARM::VSTR_FPSCR_NZCVQC_post:
6430 case ARM::VLDR_FPSCR_NZCVQC_off:
6431 case ARM::VLDR_FPSCR_NZCVQC_pre:
6432 case ARM::VLDR_FPSCR_NZCVQC_post:
6439template <
bool Writeback>
6444 case ARM::VSTR_FPSCR_pre:
6445 case ARM::VSTR_FPSCR_NZCVQC_pre:
6446 case ARM::VLDR_FPSCR_pre:
6447 case ARM::VLDR_FPSCR_NZCVQC_pre:
6448 case ARM::VSTR_FPSCR_off:
6449 case ARM::VSTR_FPSCR_NZCVQC_off:
6450 case ARM::VLDR_FPSCR_off:
6451 case ARM::VLDR_FPSCR_NZCVQC_off:
6452 case ARM::VSTR_FPSCR_post:
6453 case ARM::VSTR_FPSCR_NZCVQC_post:
6454 case ARM::VLDR_FPSCR_post:
6455 case ARM::VLDR_FPSCR_NZCVQC_post:
6459 if (!featureBits[ARM::HasMVEIntegerOps] && !featureBits[ARM::FeatureVFP2])
6497 if (!
Check(S, AddrDecoder(Inst, addr,
Address, Decoder)))
6510 DecodeTAddrModeImm7<shift>);
6520 DecodeT2AddrModeImm7<shift,1>);
6530 DecodeMveAddrModeQ<shift>);
6533template <
unsigned MinLog,
unsigned MaxLog>
6539 if (Val < MinLog || Val > MaxLog)
6546template <
unsigned start>
6573 if (!
Check(S, DecodeMVEPairVectorIndexOperand<2>(Inst, index,
Address, Decoder)))
6575 if (!
Check(S, DecodeMVEPairVectorIndexOperand<0>(Inst, index,
Address, Decoder)))
6599 if (!
Check(S, DecodeMVEPairVectorIndexOperand<2>(Inst, index,
Address, Decoder)))
6601 if (!
Check(S, DecodeMVEPairVectorIndexOperand<0>(Inst, index,
Address, Decoder)))
6625 case ARM::MVE_ASRLr:
6626 case ARM::MVE_SQRSHRL:
6629 case ARM::MVE_LSLLr:
6630 case ARM::MVE_UQRSHLL:
6677 if (Inst.
getOpcode() == ARM::MVE_SQRSHRL ||
6707template <
bool scalar, OperandDecoder predicate_decoder>
6735 if (!
Check(S, predicate_decoder(Inst, fc,
Address, Decoder)))
6786 Inst.
setOpcode(sign1 ? ARM::t2SUBspImm12 : ARM::t2ADDspImm12);
6789 Inst.
setOpcode(sign1 ? ARM::t2SUBspImm : ARM::t2ADDspImm);
6824void ARMDisassembler::UpdateThumbVFPPredicate(
6827 CC = ITBlock.getITCC();
6830 if (ITBlock.instrInITBlock())
6831 ITBlock.advanceITState();
6832 else if (VPTBlock.instrInVPTBlock()) {
6833 CC = VPTBlock.getVPTPred();
6834 VPTBlock.advanceVPTState();
6841 for (
unsigned i = 0; i < NumOps; ++i, ++
I) {
6842 if (OpInfo[i].isPredicate() ) {
6848 I->setReg(ARM::NoRegister);
6850 I->setReg(ARM::CPSR);
6860 CommentStream = &CS;
6862 assert(STI.hasFeature(ARM::ModeThumb) &&
6863 "Asked to disassemble in Thumb mode but Subtarget is in ARM mode!");
6866 if (Bytes.
size() < 2) {
6871 uint16_t Insn16 = llvm::support::endian::read<uint16_t>(
6872 Bytes.
data(), InstructionEndianness);
6874 decodeInstruction(DecoderTableThumb16,
MI, Insn16, Address,
this, STI);
6877 Check(Result, AddThumbPredicate(
MI));
6881 Result = decodeInstruction(DecoderTableThumbSBit16,
MI, Insn16, Address,
this,
6885 bool InITBlock = ITBlock.instrInITBlock();
6886 Check(Result, AddThumbPredicate(
MI));
6887 AddThumb1SBit(
MI, InITBlock);
6892 decodeInstruction(DecoderTableThumb216,
MI, Insn16, Address,
this, STI);
6898 if (
MI.getOpcode() == ARM::t2IT && ITBlock.instrInITBlock())
6901 Check(Result, AddThumbPredicate(
MI));
6906 if (
MI.getOpcode() == ARM::t2IT) {
6907 unsigned Firstcond =
MI.getOperand(0).getImm();
6908 unsigned Mask =
MI.getOperand(1).getImm();
6909 ITBlock.setITState(Firstcond, Mask);
6913 CS <<
"unpredictable IT predicate sequence";
6920 if (Bytes.
size() < 4) {
6926 (
uint32_t(Insn16) << 16) | llvm::support::endian::read<uint16_t>(
6927 Bytes.
data() + 2, InstructionEndianness);
6930 decodeInstruction(DecoderTableMVE32,
MI, Insn32, Address,
this, STI);
6936 if (
isVPTOpcode(
MI.getOpcode()) && VPTBlock.instrInVPTBlock())
6939 Check(Result, AddThumbPredicate(
MI));
6942 unsigned Mask =
MI.getOperand(0).getImm();
6943 VPTBlock.setVPTState(Mask);
6950 decodeInstruction(DecoderTableThumb32,
MI, Insn32, Address,
this, STI);
6953 bool InITBlock = ITBlock.instrInITBlock();
6954 Check(Result, AddThumbPredicate(
MI));
6955 AddThumb1SBit(
MI, InITBlock);
6960 decodeInstruction(DecoderTableThumb232,
MI, Insn32, Address,
this, STI);
6963 Check(Result, AddThumbPredicate(
MI));
6969 decodeInstruction(DecoderTableVFP32,
MI, Insn32, Address,
this, STI);
6972 UpdateThumbVFPPredicate(Result,
MI);
6978 decodeInstruction(DecoderTableVFPV832,
MI, Insn32, Address,
this, STI);
6985 Result = decodeInstruction(DecoderTableNEONDup32,
MI, Insn32, Address,
this,
6989 Check(Result, AddThumbPredicate(
MI));
6996 NEONLdStInsn &= 0xF0FFFFFF;
6997 NEONLdStInsn |= 0x04000000;
6998 Result = decodeInstruction(DecoderTableNEONLoadStore32,
MI, NEONLdStInsn,
6999 Address,
this, STI);
7002 Check(Result, AddThumbPredicate(
MI));
7009 NEONDataInsn &= 0xF0FFFFFF;
7010 NEONDataInsn |= (NEONDataInsn & 0x10000000) >> 4;
7011 NEONDataInsn |= 0x12000000;
7012 Result = decodeInstruction(DecoderTableNEONData32,
MI, NEONDataInsn,
7013 Address,
this, STI);
7016 Check(Result, AddThumbPredicate(
MI));
7021 NEONCryptoInsn &= 0xF0FFFFFF;
7022 NEONCryptoInsn |= (NEONCryptoInsn & 0x10000000) >> 4;
7023 NEONCryptoInsn |= 0x12000000;
7024 Result = decodeInstruction(DecoderTablev8Crypto32,
MI, NEONCryptoInsn,
7025 Address,
this, STI);
7032 NEONv8Insn &= 0xF3FFFFFF;
7033 Result = decodeInstruction(DecoderTablev8NEON32,
MI, NEONv8Insn, Address,
7043 ? DecoderTableThumb2CDE32
7044 : DecoderTableThumb2CoProc32;
7046 decodeInstruction(DecoderTable,
MI, Insn32, Address,
this, STI);
7049 Check(Result, AddThumbPredicate(
MI));
7055 if (ITBlock.instrInITBlock())
7056 ITBlock.advanceITState();
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.