1//===- AArch64Disassembler.cpp - Disassembler for AArch64 -----------------===// 3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4// See https://llvm.org/LICENSE.txt for license information. 5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7//===----------------------------------------------------------------------===// 10//===----------------------------------------------------------------------===// 31#define DEBUG_TYPE "aarch64-disassembler" 33// Pull DecodeStatus and its enum values into the global namespace. 36// Forward declare these because the autogenerated code will reference them. 37// Definitions are further down. 38template <
unsigned RegClassID,
unsigned FirstReg,
unsigned NumRegsInClass>
45template <
unsigned Min,
unsigned Max>
51template <
unsigned Min,
unsigned Max>
58template <
unsigned NumBitsForTile>
199template <
int ElementW
idth>
217#include "AArch64GenDisassemblerTables.inc" 218#include "AArch64GenInstrInfo.inc" 220#define Success MCDisassembler::Success 221#define Fail MCDisassembler::Fail 222#define SoftFail MCDisassembler::SoftFail 238// We want to read exactly 4 bytes of data. 243// Encoded as a small-endian 32-bit word in the stream. 245 (Bytes[3] << 24) | (Bytes[2] << 16) | (Bytes[1] << 8) | (Bytes[0] << 0);
247constuint8_t *Tables[] = {DecoderTable32, DecoderTableFallback32};
249for (
constauto *Table : Tables) {
255// For Scalable Matrix Extension (SME) instructions that have an implicit 256// operand for the accumulator (ZA) or implicit immediate zero which isn't 257// encoded, manually insert operand. 258for (
unsigned i = 0; i <
Desc.getNumOperands(); i++) {
260switch (
Desc.operands()[i].RegClass) {
263case AArch64::MPRRegClassID:
266case AArch64::MPR8RegClassID:
269case AArch64::ZTRRegClassID:
273 }
elseif (
Desc.operands()[i].OperandType ==
279if (
MI.getOpcode() == AArch64::LDR_ZA ||
280MI.getOpcode() == AArch64::STR_ZA) {
281// Spill and fill instructions have a single immediate used for both 282// the vector select offset and optional memory offset. Replicate 283// the decoded immediate. 285assert(Imm4Op.
isImm() &&
"Unexpected operand type!");
286MI.addOperand(Imm4Op);
298// AArch64 instructions are always 4 bytes wide, so there's no point 299// in skipping any smaller number of bytes if an instruction can't 308 std::unique_ptr<MCRelocationInfo> &&RelInfo) {
310 SymbolLookUp, DisInfo);
337template <
unsigned RegClassID,
unsigned FirstReg,
unsigned NumRegsInClass>
341if (RegNo > NumRegsInClass - 1)
345 AArch64MCRegisterClasses[RegClassID].getRegister(RegNo + FirstReg);
359 AArch64MCRegisterClasses[AArch64::GPR64x8ClassRegClassID].getRegister(
365template <
unsigned Min,
unsigned Max>
369unsigned Reg = (RegNo * 2) + Min;
370if (Reg < Min || Reg > Max || (Reg & 1))
373 AArch64MCRegisterClasses[AArch64::ZPRRegClassID].getRegister(Reg);
378template <
unsigned Min,
unsigned Max>
382unsigned Reg = (RegNo * 2) + Min;
383if (Reg < Min || Reg > Max || (Reg & 1))
387 AArch64MCRegisterClasses[AArch64::ZPR2RegClassID].getRegister(Reg);
398 AArch64MCRegisterClasses[AArch64::ZPR_KRegClassID].getRegister(RegNo);
409 AArch64MCRegisterClasses[AArch64::ZPR4RegClassID].getRegister(RegNo * 4);
426 {AArch64::ZAH0, AArch64::ZAH1},
427 {AArch64::ZAS0, AArch64::ZAS1, AArch64::ZAS2, AArch64::ZAS3},
428 {AArch64::ZAD0, AArch64::ZAD1, AArch64::ZAD2, AArch64::ZAD3, AArch64::ZAD4,
429 AArch64::ZAD5, AArch64::ZAD6, AArch64::ZAD7},
430 {AArch64::ZAQ0, AArch64::ZAQ1, AArch64::ZAQ2, AArch64::ZAQ3, AArch64::ZAQ4,
431 AArch64::ZAQ5, AArch64::ZAQ6, AArch64::ZAQ7, AArch64::ZAQ8, AArch64::ZAQ9,
432 AArch64::ZAQ10, AArch64::ZAQ11, AArch64::ZAQ12, AArch64::ZAQ13,
433 AArch64::ZAQ14, AArch64::ZAQ15}};
435template <
unsigned NumBitsForTile>
439unsigned LastReg = (1 << NumBitsForTile) - 1;
453 AArch64MCRegisterClasses[AArch64::PPR2RegClassID].getRegister(RegNo * 2);
461// scale{5} is asserted as 1 in tblgen. 477// Immediate is encoded as the top 16-bits of an unsigned 18-bit negative 478// PC-relative offset. 480if (ImmVal > (1 << 16))
484/*IsBranch=*/false, 0, 0, 4))
492 int64_t ImmVal = Imm;
494// Sign-extend 19-bit immediate. 495if (ImmVal & (1 << (19 - 1)))
496 ImmVal |= ~((1LL << 19) - 1);
499 Inst, ImmVal * 4,
Addr, Inst.
getOpcode() != AArch64::LDRXl, 0, 0, 4))
506 int64_t ImmVal = Imm;
508// Sign-extend 9-bit immediate. 509if (ImmVal & (1 << (9 - 1)))
510 ImmVal |= ~((1LL << 9) - 1);
513/*IsBranch=*/true, 0, 0, 4))
531// Every system register in the encoding space is valid with the syntax 532// S<op0>_<op1>_<Cn>_<Cm>_<op2>, so decoding system registers always succeeds. 547// This decoder exists to add the dummy Lane operand to the MCInst, which must 548// be 1 in assembly but has no other real manifestation. 549unsigned Rd = fieldFromInstruction(
Insn, 0, 5);
550unsigned Rn = fieldFromInstruction(
Insn, 5, 5);
551unsigned IsToVec = fieldFromInstruction(
Insn, 16, 1);
554 DecodeSimpleRegisterClass<AArch64::FPR128RegClassID, 0, 32>(
556 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(
559 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(
561 DecodeSimpleRegisterClass<AArch64::FPR128RegClassID, 0, 32>(
652unsigned Rd = fieldFromInstruction(insn, 0, 5);
653unsigned Rn = fieldFromInstruction(insn, 5, 5);
654unsigned Rm = fieldFromInstruction(insn, 16, 5);
655unsigned shiftHi = fieldFromInstruction(insn, 22, 2);
656unsigned shiftLo = fieldFromInstruction(insn, 10, 6);
657unsigned shift = (shiftHi << 6) | shiftLo;
662case AArch64::ADDSWrs:
664case AArch64::SUBSWrs:
665// if shift == '11' then ReservedValue() 670case AArch64::ANDSWrs:
672case AArch64::BICSWrs:
676case AArch64::EONWrs: {
677// if sf == '0' and imm6<5> == '1' then ReservedValue() 678if (shiftLo >> 5 == 1)
680 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rd,
Addr,
682 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rn,
Addr,
684 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rm,
Addr,
689case AArch64::ADDSXrs:
691case AArch64::SUBSXrs:
692// if shift == '11' then ReservedValue() 697case AArch64::ANDSXrs:
699case AArch64::BICSXrs:
704 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(Inst, Rd,
Addr,
706 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(Inst, Rn,
Addr,
708 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(Inst, Rm,
Addr,
720unsigned Rd = fieldFromInstruction(insn, 0, 5);
721unsigned imm = fieldFromInstruction(insn, 5, 16);
722unsigned shift = fieldFromInstruction(insn, 21, 2);
730if (shift & (1U << 5))
732 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rd,
Addr,
738 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(Inst, Rd,
Addr,
743if (Inst.
getOpcode() == AArch64::MOVKWi ||
755unsigned Rt = fieldFromInstruction(insn, 0, 5);
756unsigned Rn = fieldFromInstruction(insn, 5, 5);
757unsigned offset = fieldFromInstruction(insn, 10, 12);
763// Rt is an immediate in prefetch. 766case AArch64::STRBBui:
767case AArch64::LDRBBui:
768case AArch64::LDRSBWui:
769case AArch64::STRHHui:
770case AArch64::LDRHHui:
771case AArch64::LDRSHWui:
774 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rt,
Addr,
777case AArch64::LDRSBXui:
778case AArch64::LDRSHXui:
779case AArch64::LDRSWui:
782 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(Inst, Rt,
Addr,
787 DecodeSimpleRegisterClass<AArch64::FPR128RegClassID, 0, 32>(Inst, Rt,
Addr,
792 DecodeSimpleRegisterClass<AArch64::FPR64RegClassID, 0, 32>(Inst, Rt,
Addr,
797 DecodeSimpleRegisterClass<AArch64::FPR32RegClassID, 0, 32>(Inst, Rt,
Addr,
802 DecodeSimpleRegisterClass<AArch64::FPR16RegClassID, 0, 32>(Inst, Rt,
Addr,
807 DecodeSimpleRegisterClass<AArch64::FPR8RegClassID, 0, 32>(Inst, Rt,
Addr,
812 DecodeSimpleRegisterClass<AArch64::GPR64spRegClassID, 0, 32>(Inst, Rn,
Addr,
822unsigned Rt = fieldFromInstruction(insn, 0, 5);
823unsigned Rn = fieldFromInstruction(insn, 5, 5);
824 int64_t offset = fieldFromInstruction(insn, 12, 9);
826// offset is a 9-bit signed immediate, so sign extend it to 828if (offset & (1 << (9 - 1)))
829 offset |= ~((1LL << 9) - 1);
831// First operand is always the writeback to the address register, if needed. 835case AArch64::LDRSBWpre:
836case AArch64::LDRSHWpre:
837case AArch64::STRBBpre:
838case AArch64::LDRBBpre:
839case AArch64::STRHHpre:
840case AArch64::LDRHHpre:
841case AArch64::STRWpre:
842case AArch64::LDRWpre:
843case AArch64::LDRSBWpost:
844case AArch64::LDRSHWpost:
845case AArch64::STRBBpost:
846case AArch64::LDRBBpost:
847case AArch64::STRHHpost:
848case AArch64::LDRHHpost:
849case AArch64::STRWpost:
850case AArch64::LDRWpost:
851case AArch64::LDRSBXpre:
852case AArch64::LDRSHXpre:
853case AArch64::STRXpre:
854case AArch64::LDRSWpre:
855case AArch64::LDRXpre:
856case AArch64::LDRSBXpost:
857case AArch64::LDRSHXpost:
858case AArch64::STRXpost:
859case AArch64::LDRSWpost:
860case AArch64::LDRXpost:
861case AArch64::LDRQpre:
862case AArch64::STRQpre:
863case AArch64::LDRQpost:
864case AArch64::STRQpost:
865case AArch64::LDRDpre:
866case AArch64::STRDpre:
867case AArch64::LDRDpost:
868case AArch64::STRDpost:
869case AArch64::LDRSpre:
870case AArch64::STRSpre:
871case AArch64::LDRSpost:
872case AArch64::STRSpost:
873case AArch64::LDRHpre:
874case AArch64::STRHpre:
875case AArch64::LDRHpost:
876case AArch64::STRHpost:
877case AArch64::LDRBpre:
878case AArch64::STRBpre:
879case AArch64::LDRBpost:
880case AArch64::STRBpost:
881 DecodeSimpleRegisterClass<AArch64::GPR64spRegClassID, 0, 32>(Inst, Rn,
Addr,
890// Rt is an immediate in prefetch. 893case AArch64::STURBBi:
894case AArch64::LDURBBi:
895case AArch64::LDURSBWi:
896case AArch64::STURHHi:
897case AArch64::LDURHHi:
898case AArch64::LDURSHWi:
901case AArch64::LDTRSBWi:
902case AArch64::LDTRSHWi:
909case AArch64::LDRSBWpre:
910case AArch64::LDRSHWpre:
911case AArch64::STRBBpre:
912case AArch64::LDRBBpre:
913case AArch64::STRHHpre:
914case AArch64::LDRHHpre:
915case AArch64::STRWpre:
916case AArch64::LDRWpre:
917case AArch64::LDRSBWpost:
918case AArch64::LDRSHWpost:
919case AArch64::STRBBpost:
920case AArch64::LDRBBpost:
921case AArch64::STRHHpost:
922case AArch64::LDRHHpost:
923case AArch64::STRWpost:
924case AArch64::LDRWpost:
925case AArch64::STLURBi:
926case AArch64::STLURHi:
927case AArch64::STLURWi:
928case AArch64::LDAPURBi:
929case AArch64::LDAPURSBWi:
930case AArch64::LDAPURHi:
931case AArch64::LDAPURSHWi:
932case AArch64::LDAPURi:
933 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rt,
Addr,
936case AArch64::LDURSBXi:
937case AArch64::LDURSHXi:
938case AArch64::LDURSWi:
941case AArch64::LDTRSBXi:
942case AArch64::LDTRSHXi:
943case AArch64::LDTRSWi:
946case AArch64::LDRSBXpre:
947case AArch64::LDRSHXpre:
948case AArch64::STRXpre:
949case AArch64::LDRSWpre:
950case AArch64::LDRXpre:
951case AArch64::LDRSBXpost:
952case AArch64::LDRSHXpost:
953case AArch64::STRXpost:
954case AArch64::LDRSWpost:
955case AArch64::LDRXpost:
956case AArch64::LDAPURSWi:
957case AArch64::LDAPURSHXi:
958case AArch64::LDAPURSBXi:
959case AArch64::STLURXi:
960case AArch64::LDAPURXi:
961 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(Inst, Rt,
Addr,
966case AArch64::LDRQpre:
967case AArch64::STRQpre:
968case AArch64::LDRQpost:
969case AArch64::STRQpost:
970 DecodeSimpleRegisterClass<AArch64::FPR128RegClassID, 0, 32>(Inst, Rt,
Addr,
975case AArch64::LDRDpre:
976case AArch64::STRDpre:
977case AArch64::LDRDpost:
978case AArch64::STRDpost:
979 DecodeSimpleRegisterClass<AArch64::FPR64RegClassID, 0, 32>(Inst, Rt,
Addr,
984case AArch64::LDRSpre:
985case AArch64::STRSpre:
986case AArch64::LDRSpost:
987case AArch64::STRSpost:
988 DecodeSimpleRegisterClass<AArch64::FPR32RegClassID, 0, 32>(Inst, Rt,
Addr,
993case AArch64::LDRHpre:
994case AArch64::STRHpre:
995case AArch64::LDRHpost:
996case AArch64::STRHpost:
997 DecodeSimpleRegisterClass<AArch64::FPR16RegClassID, 0, 32>(Inst, Rt,
Addr,
1000case AArch64::LDURBi:
1001case AArch64::STURBi:
1002case AArch64::LDRBpre:
1003case AArch64::STRBpre:
1004case AArch64::LDRBpost:
1005case AArch64::STRBpost:
1006 DecodeSimpleRegisterClass<AArch64::FPR8RegClassID, 0, 32>(Inst, Rt,
Addr,
1011 DecodeSimpleRegisterClass<AArch64::GPR64spRegClassID, 0, 32>(Inst, Rn,
Addr,
1015bool IsLoad = fieldFromInstruction(insn, 22, 1);
1016bool IsIndexed = fieldFromInstruction(insn, 10, 2) != 0;
1017bool IsFP = fieldFromInstruction(insn, 26, 1);
1019// Cannot write back to a transfer register (but xzr != sp). 1020if (IsLoad && IsIndexed && !IsFP && Rn != 31 && Rt == Rn)
1029unsigned Rt = fieldFromInstruction(insn, 0, 5);
1030unsigned Rn = fieldFromInstruction(insn, 5, 5);
1031unsigned Rt2 = fieldFromInstruction(insn, 10, 5);
1032unsigned Rs = fieldFromInstruction(insn, 16, 5);
1038case AArch64::STLXRW:
1039case AArch64::STLXRB:
1040case AArch64::STLXRH:
1044 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rs,
Addr,
1050case AArch64::LDAXRW:
1051case AArch64::LDAXRB:
1052case AArch64::LDAXRH:
1059case AArch64::STLLRW:
1060case AArch64::STLLRB:
1061case AArch64::STLLRH:
1062case AArch64::LDLARW:
1063case AArch64::LDLARB:
1064case AArch64::LDLARH:
1065 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rt,
Addr,
1068case AArch64::STLXRX:
1070 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rs,
Addr,
1074case AArch64::LDAXRX:
1077case AArch64::LDLARX:
1078case AArch64::STLLRX:
1079 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(Inst, Rt,
Addr,
1082case AArch64::STLXPW:
1084 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rs,
Addr,
1087case AArch64::LDAXPW:
1089 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rt,
Addr,
1091 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rt2,
Addr,
1094case AArch64::STLXPX:
1096 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rs,
Addr,
1099case AArch64::LDAXPX:
1101 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(Inst, Rt,
Addr,
1103 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(Inst, Rt2,
Addr,
1108 DecodeSimpleRegisterClass<AArch64::GPR64spRegClassID, 0, 32>(Inst, Rn,
Addr,
1111// You shouldn't load to the same register twice in an instruction... 1112if ((Opcode == AArch64::LDAXPW || Opcode == AArch64::LDXPW ||
1113 Opcode == AArch64::LDAXPX || Opcode == AArch64::LDXPX) &&
1123unsigned Rt = fieldFromInstruction(insn, 0, 5);
1124unsigned Rn = fieldFromInstruction(insn, 5, 5);
1125unsigned Rt2 = fieldFromInstruction(insn, 10, 5);
1126 int64_t offset = fieldFromInstruction(insn, 15, 7);
1127bool IsLoad = fieldFromInstruction(insn, 22, 1);
1129// offset is a 7-bit signed immediate, so sign extend it to 1130// fill the unsigned. 1131if (offset & (1 << (7 - 1)))
1132 offset |= ~((1LL << 7) - 1);
1135bool NeedsDisjointWritebackTransfer =
false;
1137// First operand is always writeback of base register. 1141case AArch64::LDPXpost:
1142case AArch64::STPXpost:
1143case AArch64::LDPSWpost:
1144case AArch64::LDPXpre:
1145case AArch64::STPXpre:
1146case AArch64::LDPSWpre:
1147case AArch64::LDPWpost:
1148case AArch64::STPWpost:
1149case AArch64::LDPWpre:
1150case AArch64::STPWpre:
1151case AArch64::LDPQpost:
1152case AArch64::STPQpost:
1153case AArch64::LDPQpre:
1154case AArch64::STPQpre:
1155case AArch64::LDPDpost:
1156case AArch64::STPDpost:
1157case AArch64::LDPDpre:
1158case AArch64::STPDpre:
1159case AArch64::LDPSpost:
1160case AArch64::STPSpost:
1161case AArch64::LDPSpre:
1162case AArch64::STPSpre:
1163case AArch64::STGPpre:
1164case AArch64::STGPpost:
1165case AArch64::LDTPpre:
1166case AArch64::LDTPpost:
1167case AArch64::LDTPQpost:
1168case AArch64::LDTPQpre:
1169case AArch64::STTPpost:
1170case AArch64::STTPpre:
1171case AArch64::STTPQpost:
1172case AArch64::STTPQpre:
1173 DecodeSimpleRegisterClass<AArch64::GPR64spRegClassID, 0, 32>(Inst, Rn,
Addr,
1181case AArch64::LDPXpost:
1182case AArch64::STPXpost:
1183case AArch64::LDPSWpost:
1184case AArch64::LDPXpre:
1185case AArch64::STPXpre:
1186case AArch64::LDPSWpre:
1187case AArch64::STGPpre:
1188case AArch64::STGPpost:
1189case AArch64::LDTPpost:
1190case AArch64::LDTPpre:
1191case AArch64::STTPpost:
1192case AArch64::STTPpre:
1193 NeedsDisjointWritebackTransfer =
true;
1195case AArch64::LDNPXi:
1196case AArch64::STNPXi:
1199case AArch64::LDPSWi:
1203case AArch64::STTNPXi:
1204case AArch64::LDTNPXi:
1205 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(Inst, Rt,
Addr,
1207 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(Inst, Rt2,
Addr,
1210case AArch64::LDPWpost:
1211case AArch64::STPWpost:
1212case AArch64::LDPWpre:
1213case AArch64::STPWpre:
1214 NeedsDisjointWritebackTransfer =
true;
1216case AArch64::LDNPWi:
1217case AArch64::STNPWi:
1220 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rt,
Addr,
1222 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rt2,
Addr,
1225case AArch64::LDNPQi:
1226case AArch64::STNPQi:
1227case AArch64::LDPQpost:
1228case AArch64::STPQpost:
1231case AArch64::LDPQpre:
1232case AArch64::STPQpre:
1233case AArch64::LDTPQi:
1234case AArch64::LDTPQpost:
1235case AArch64::LDTPQpre:
1236case AArch64::LDTNPQi:
1237case AArch64::STTPQi:
1238case AArch64::STTPQpost:
1239case AArch64::STTPQpre:
1240case AArch64::STTNPQi:
1241 DecodeSimpleRegisterClass<AArch64::FPR128RegClassID, 0, 32>(Inst, Rt,
Addr,
1243 DecodeSimpleRegisterClass<AArch64::FPR128RegClassID, 0, 32>(Inst, Rt2,
Addr,
1246case AArch64::LDNPDi:
1247case AArch64::STNPDi:
1248case AArch64::LDPDpost:
1249case AArch64::STPDpost:
1252case AArch64::LDPDpre:
1253case AArch64::STPDpre:
1254 DecodeSimpleRegisterClass<AArch64::FPR64RegClassID, 0, 32>(Inst, Rt,
Addr,
1256 DecodeSimpleRegisterClass<AArch64::FPR64RegClassID, 0, 32>(Inst, Rt2,
Addr,
1259case AArch64::LDNPSi:
1260case AArch64::STNPSi:
1261case AArch64::LDPSpost:
1262case AArch64::STPSpost:
1265case AArch64::LDPSpre:
1266case AArch64::STPSpre:
1267 DecodeSimpleRegisterClass<AArch64::FPR32RegClassID, 0, 32>(Inst, Rt,
Addr,
1269 DecodeSimpleRegisterClass<AArch64::FPR32RegClassID, 0, 32>(Inst, Rt2,
Addr,
1274 DecodeSimpleRegisterClass<AArch64::GPR64spRegClassID, 0, 32>(Inst, Rn,
Addr,
1278// You shouldn't load to the same register twice in an instruction... 1279if (IsLoad && Rt == Rt2)
1282// ... or do any operation that writes-back to a transfer register. But note 1283// that "stp xzr, xzr, [sp], #4" is fine because xzr and sp are different. 1284if (NeedsDisjointWritebackTransfer && Rn != 31 && (Rt == Rn || Rt2 == Rn))
1293unsigned Rt = fieldFromInstruction(insn, 0, 5);
1294unsigned Rn = fieldFromInstruction(insn, 5, 5);
1295uint64_t offset = fieldFromInstruction(insn, 22, 1) << 9 |
1296 fieldFromInstruction(insn, 12, 9);
1297unsigned writeback = fieldFromInstruction(insn, 11, 1);
1302case AArch64::LDRAAwriteback:
1303case AArch64::LDRABwriteback:
1304 DecodeSimpleRegisterClass<AArch64::GPR64spRegClassID, 0, 32>(
1305 Inst, Rn
/* writeback register */,
Addr, Decoder);
1307case AArch64::LDRAAindexed:
1308case AArch64::LDRABindexed:
1312 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(Inst, Rt,
Addr,
1314 DecodeSimpleRegisterClass<AArch64::GPR64spRegClassID, 0, 32>(Inst, Rn,
Addr,
1316 DecodeSImm<10>(Inst, offset,
Addr, Decoder);
1318if (writeback && Rt == Rn && Rn != 31) {
1328unsigned Rd = fieldFromInstruction(insn, 0, 5);
1329unsigned Rn = fieldFromInstruction(insn, 5, 5);
1330unsigned Rm = fieldFromInstruction(insn, 16, 5);
1331unsigned extend = fieldFromInstruction(insn, 10, 6);
1333unsigned shift = extend & 0x7;
1340case AArch64::ADDWrx:
1341case AArch64::SUBWrx:
1342 DecodeSimpleRegisterClass<AArch64::GPR32spRegClassID, 0, 32>(Inst, Rd,
Addr,
1344 DecodeSimpleRegisterClass<AArch64::GPR32spRegClassID, 0, 32>(Inst, Rn,
Addr,
1346 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rm,
Addr,
1349case AArch64::ADDSWrx:
1350case AArch64::SUBSWrx:
1351 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rd,
Addr,
1353 DecodeSimpleRegisterClass<AArch64::GPR32spRegClassID, 0, 32>(Inst, Rn,
Addr,
1355 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rm,
Addr,
1358case AArch64::ADDXrx:
1359case AArch64::SUBXrx:
1360 DecodeSimpleRegisterClass<AArch64::GPR64spRegClassID, 0, 32>(Inst, Rd,
Addr,
1362 DecodeSimpleRegisterClass<AArch64::GPR64spRegClassID, 0, 32>(Inst, Rn,
Addr,
1364 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rm,
Addr,
1367case AArch64::ADDSXrx:
1368case AArch64::SUBSXrx:
1369 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(Inst, Rd,
Addr,
1371 DecodeSimpleRegisterClass<AArch64::GPR64spRegClassID, 0, 32>(Inst, Rn,
Addr,
1373 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rm,
Addr,
1376case AArch64::ADDXrx64:
1377case AArch64::SUBXrx64:
1378 DecodeSimpleRegisterClass<AArch64::GPR64spRegClassID, 0, 32>(Inst, Rd,
Addr,
1380 DecodeSimpleRegisterClass<AArch64::GPR64spRegClassID, 0, 32>(Inst, Rn,
Addr,
1382 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(Inst, Rm,
Addr,
1385case AArch64::SUBSXrx64:
1386case AArch64::ADDSXrx64:
1387 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(Inst, Rd,
Addr,
1389 DecodeSimpleRegisterClass<AArch64::GPR64spRegClassID, 0, 32>(Inst, Rn,
Addr,
1391 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(Inst, Rm,
Addr,
1403unsigned Rd = fieldFromInstruction(insn, 0, 5);
1404unsigned Rn = fieldFromInstruction(insn, 5, 5);
1405unsigned Datasize = fieldFromInstruction(insn, 31, 1);
1409if (Inst.
getOpcode() == AArch64::ANDSXri)
1410 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(Inst, Rd,
Addr,
1413 DecodeSimpleRegisterClass<AArch64::GPR64spRegClassID, 0, 32>(
1414 Inst, Rd,
Addr, Decoder);
1415 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(Inst, Rn,
Addr,
1417 imm = fieldFromInstruction(insn, 10, 13);
1421if (Inst.
getOpcode() == AArch64::ANDSWri)
1422 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rd,
Addr,
1425 DecodeSimpleRegisterClass<AArch64::GPR32spRegClassID, 0, 32>(
1426 Inst, Rd,
Addr, Decoder);
1427 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rn,
Addr,
1429 imm = fieldFromInstruction(insn, 10, 12);
1440unsigned Rd = fieldFromInstruction(insn, 0, 5);
1441unsigned cmode = fieldFromInstruction(insn, 12, 4);
1442unsigned imm = fieldFromInstruction(insn, 16, 3) << 5;
1443 imm |= fieldFromInstruction(insn, 5, 5);
1446 DecodeSimpleRegisterClass<AArch64::FPR64RegClassID, 0, 32>(Inst, Rd,
Addr,
1449 DecodeSimpleRegisterClass<AArch64::FPR128RegClassID, 0, 32>(Inst, Rd,
Addr,
1457case AArch64::MOVIv4i16:
1458case AArch64::MOVIv8i16:
1459case AArch64::MVNIv4i16:
1460case AArch64::MVNIv8i16:
1461case AArch64::MOVIv2i32:
1462case AArch64::MOVIv4i32:
1463case AArch64::MVNIv2i32:
1464case AArch64::MVNIv4i32:
1467case AArch64::MOVIv2s_msl:
1468case AArch64::MOVIv4s_msl:
1469case AArch64::MVNIv2s_msl:
1470case AArch64::MVNIv4s_msl:
1481unsigned Rd = fieldFromInstruction(insn, 0, 5);
1482unsigned cmode = fieldFromInstruction(insn, 12, 4);
1483unsigned imm = fieldFromInstruction(insn, 16, 3) << 5;
1484 imm |= fieldFromInstruction(insn, 5, 5);
1486// Tied operands added twice. 1487 DecodeSimpleRegisterClass<AArch64::FPR128RegClassID, 0, 32>(Inst, Rd,
Addr,
1489 DecodeSimpleRegisterClass<AArch64::FPR128RegClassID, 0, 32>(Inst, Rd,
Addr,
1501unsigned Rd = fieldFromInstruction(insn, 0, 5);
1502 int64_t imm = fieldFromInstruction(insn, 5, 19) << 2;
1503 imm |= fieldFromInstruction(insn, 29, 2);
1505// Sign-extend the 21-bit immediate. 1506if (imm & (1 << (21 - 1)))
1507 imm |= ~((1LL << 21) - 1);
1509 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(Inst, Rd,
Addr,
1520unsigned Rd = fieldFromInstruction(insn, 0, 5);
1521unsigned Rn = fieldFromInstruction(insn, 5, 5);
1522unsigned Imm = fieldFromInstruction(insn, 10, 14);
1523unsigned S = fieldFromInstruction(insn, 29, 1);
1524unsigned Datasize = fieldFromInstruction(insn, 31, 1);
1526unsigned ShifterVal = (Imm >> 12) & 3;
1527unsigned ImmVal = Imm & 0xFFF;
1529if (ShifterVal != 0 && ShifterVal != 1)
1534 DecodeSimpleRegisterClass<AArch64::GPR64spRegClassID, 0, 32>(
1535 Inst, Rd,
Addr, Decoder);
1537 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(Inst, Rd,
Addr,
1539 DecodeSimpleRegisterClass<AArch64::GPR64spRegClassID, 0, 32>(Inst, Rn,
Addr,
1543 DecodeSimpleRegisterClass<AArch64::GPR32spRegClassID, 0, 32>(
1544 Inst, Rd,
Addr, Decoder);
1546 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rd,
Addr,
1548 DecodeSimpleRegisterClass<AArch64::GPR32spRegClassID, 0, 32>(Inst, Rn,
Addr,
1561 int64_t imm = fieldFromInstruction(insn, 0, 26);
1563// Sign-extend the 26-bit immediate. 1564if (imm & (1 << (26 - 1)))
1565 imm |= ~((1LL << 26) - 1);
1574return Op1 == 0b000 && (Op2 == 0b000 ||
// CFINV 1575 Op2 == 0b001 ||
// XAFlag 1576 Op2 == 0b010);
// AXFlag 1582uint64_t op1 = fieldFromInstruction(insn, 16, 3);
1583uint64_t op2 = fieldFromInstruction(insn, 5, 3);
1584uint64_t imm = fieldFromInstruction(insn, 8, 4);
1585uint64_t pstate_field = (op1 << 3) | op2;
1593auto PState = AArch64PState::lookupPStateImm0_15ByEncoding(pstate_field);
1603uint64_t op1 = fieldFromInstruction(insn, 16, 3);
1604uint64_t op2 = fieldFromInstruction(insn, 5, 3);
1605uint64_t crm_high = fieldFromInstruction(insn, 9, 3);
1606uint64_t imm = fieldFromInstruction(insn, 8, 1);
1607uint64_t pstate_field = (crm_high << 6) | (op1 << 3) | op2;
1615auto PState = AArch64PState::lookupPStateImm0_1ByEncoding(pstate_field);
1625uint64_t Rt = fieldFromInstruction(insn, 0, 5);
1626uint64_t bit = fieldFromInstruction(insn, 31, 1) << 5;
1627 bit |= fieldFromInstruction(insn, 19, 5);
1628 int64_t dst = fieldFromInstruction(insn, 5, 14);
1630// Sign-extend 14-bit immediate. 1631if (dst & (1 << (14 - 1)))
1632 dst |= ~((1LL << 14) - 1);
1634if (fieldFromInstruction(insn, 31, 1) == 0)
1635 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rt,
Addr,
1638 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(Inst, Rt,
Addr,
1651// Register number must be even (see CASP instruction) 1655unsigned Reg = AArch64MCRegisterClasses[RegClassID].getRegister(RegNo / 2);
1664 Inst, AArch64::WSeqPairsClassRegClassID, RegNo,
Addr, Decoder);
1671 Inst, AArch64::XSeqPairsClassRegClassID, RegNo,
Addr, Decoder);
1677unsigned op1 = fieldFromInstruction(insn, 16, 3);
1678unsigned CRn = fieldFromInstruction(insn, 12, 4);
1679unsigned CRm = fieldFromInstruction(insn, 8, 4);
1680unsigned op2 = fieldFromInstruction(insn, 5, 3);
1681unsigned Rt = fieldFromInstruction(insn, 0, 5);
1689 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(Inst, Rt,
Addr,
1698unsigned Zdn = fieldFromInstruction(insn, 0, 5);
1699unsigned imm = fieldFromInstruction(insn, 5, 13);
1703// The same (tied) operand is added twice to the instruction. 1704 DecodeSimpleRegisterClass<AArch64::ZPRRegClassID, 0, 32>(Inst, Zdn,
Addr,
1706if (Inst.
getOpcode() != AArch64::DUPM_ZI)
1707 DecodeSimpleRegisterClass<AArch64::ZPRRegClassID, 0, 32>(Inst, Zdn,
Addr,
1716if (Imm & ~((1LL << Bits) - 1))
1719// Imm is a signed immediate, so sign extend it. 1720if (Imm & (1 << (Bits - 1)))
1721 Imm |= ~((1LL << Bits) - 1);
1727// Decode 8-bit signed/unsigned immediate for a given element width. 1728template <
int ElementW
idth>
1732unsigned Shift = (Imm & 0x100) ? 8 : 0;
1733if (ElementWidth == 8 && Shift)
1740// Decode uimm4 ranged from 1-16. 1750if (AArch64SVCR::lookupSVCRByEncoding(Imm)) {
1760unsigned Rd = fieldFromInstruction(insn, 0, 5);
1761unsigned Rs = fieldFromInstruction(insn, 16, 5);
1762unsigned Rn = fieldFromInstruction(insn, 5, 5);
1764// None of the registers may alias: if they do, then the instruction is not 1765// merely unpredictable but actually entirely unallocated. 1766if (Rd == Rs || Rs == Rn || Rd == Rn)
1769// All three register operands are written back, so they all appear 1770// twice in the operand list, once as outputs and once as inputs. 1771if (!DecodeSimpleRegisterClass<AArch64::GPR64commonRegClassID, 0, 31>(
1772 Inst, Rd,
Addr, Decoder) ||
1773 !DecodeSimpleRegisterClass<AArch64::GPR64commonRegClassID, 0, 31>(
1774 Inst, Rs,
Addr, Decoder) ||
1775 !DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(
1776 Inst, Rn,
Addr, Decoder) ||
1777 !DecodeSimpleRegisterClass<AArch64::GPR64commonRegClassID, 0, 31>(
1778 Inst, Rd,
Addr, Decoder) ||
1779 !DecodeSimpleRegisterClass<AArch64::GPR64commonRegClassID, 0, 31>(
1780 Inst, Rs,
Addr, Decoder) ||
1781 !DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(
1782 Inst, Rn,
Addr, Decoder))
1791unsigned Rd = fieldFromInstruction(insn, 0, 5);
1792unsigned Rm = fieldFromInstruction(insn, 16, 5);
1793unsigned Rn = fieldFromInstruction(insn, 5, 5);
1795// None of the registers may alias: if they do, then the instruction is not 1796// merely unpredictable but actually entirely unallocated. 1797if (Rd == Rm || Rm == Rn || Rd == Rn)
1800// Rd and Rn (not Rm) register operands are written back, so they appear 1801// twice in the operand list, once as outputs and once as inputs. 1802if (!DecodeSimpleRegisterClass<AArch64::GPR64commonRegClassID, 0, 31>(
1803 Inst, Rd,
Addr, Decoder) ||
1804 !DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(
1805 Inst, Rn,
Addr, Decoder) ||
1806 !DecodeSimpleRegisterClass<AArch64::GPR64commonRegClassID, 0, 31>(
1807 Inst, Rd,
Addr, Decoder) ||
1808 !DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(
1809 Inst, Rn,
Addr, Decoder) ||
1810 !DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(
1811 Inst, Rm,
Addr, Decoder))
1820// PRFM with Rt = '11xxx' should be decoded as RPRFM. 1821// Fail to decode and defer to fallback decoder table to decode RPRFM. 1822unsigned Mask = 0x18;
1823uint64_t Rt = fieldFromInstruction(insn, 0, 5);
1824if ((Rt & Mask) == Mask)
1827uint64_t Rn = fieldFromInstruction(insn, 5, 5);
1828uint64_t Shift = fieldFromInstruction(insn, 12, 1);
1829uint64_t Extend = fieldFromInstruction(insn, 15, 1);
1830uint64_t Rm = fieldFromInstruction(insn, 16, 5);
1833 DecodeSimpleRegisterClass<AArch64::GPR64spRegClassID, 0, 32>(Inst, Rn,
Addr,
1839case AArch64::PRFMroW:
1840 DecodeSimpleRegisterClass<AArch64::GPR32RegClassID, 0, 32>(Inst, Rm,
Addr,
1843case AArch64::PRFMroX:
1844 DecodeSimpleRegisterClass<AArch64::GPR64RegClassID, 0, 32>(Inst, Rm,
Addr,
static DecodeStatus DecodeUnconditionalBranch(MCInst &Inst, uint32_t insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeZPRMul2_MinMax(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVecShiftL64Imm(MCInst &Inst, unsigned Imm, uint64_t Addr, const MCDisassembler *Decoder)
static DecodeStatus DecodeVecShiftL32Imm(MCInst &Inst, unsigned Imm, uint64_t Addr, const MCDisassembler *Decoder)
static MCSymbolizer * createAArch64ExternalSymbolizer(const Triple &TT, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp, void *DisInfo, MCContext *Ctx, std::unique_ptr< MCRelocationInfo > &&RelInfo)
static DecodeStatus DecodeCPYMemOpInstruction(MCInst &Inst, uint32_t insn, uint64_t Addr, const MCDisassembler *Decoder)
static DecodeStatus DecodeVecShiftR8Imm(MCInst &Inst, unsigned Imm, uint64_t Addr, const MCDisassembler *Decoder)
static DecodeStatus DecodeFixedPointScaleImm64(MCInst &Inst, unsigned Imm, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeAddSubERegInstruction(MCInst &Inst, uint32_t insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeModImmInstruction(MCInst &Inst, uint32_t insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeLogicalImmInstruction(MCInst &Inst, uint32_t insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMoveImmInstruction(MCInst &Inst, uint32_t insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSystemPStateImm0_1Instruction(MCInst &Inst, uint32_t insn, uint64_t Address, const MCDisassembler *Decoder)
static MCDisassembler * createAArch64Disassembler(const Target &T, const MCSubtargetInfo &STI, MCContext &Ctx)
static DecodeStatus DecodeGPR64x8ClassRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeUnsignedLdStInstruction(MCInst &Inst, uint32_t insn, uint64_t Address, const MCDisassembler *Decoder)
static const MCPhysReg MatrixZATileDecoderTable[5][16]
static DecodeStatus DecodeXSeqPairsClassRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Addr, const MCDisassembler *Decoder)
static DecodeStatus DecodeAuthLoadInstruction(MCInst &Inst, uint32_t insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVecShiftL16Imm(MCInst &Inst, unsigned Imm, uint64_t Addr, const MCDisassembler *Decoder)
static DecodeStatus DecodePairLdStInstruction(MCInst &Inst, uint32_t insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMatrixTile(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSImm(MCInst &Inst, uint64_t Imm, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVecShiftR32ImmNarrow(MCInst &Inst, unsigned Imm, uint64_t Addr, const MCDisassembler *Decoder)
static DecodeStatus DecodeZK(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodePPR2Mul2RegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const void *Decoder)
static DecodeStatus DecodeSystemPStateImm0_15Instruction(MCInst &Inst, uint32_t insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVecShiftL8Imm(MCInst &Inst, unsigned Imm, uint64_t Addr, const MCDisassembler *Decoder)
static DecodeStatus DecodePCRelLabel16(MCInst &Inst, unsigned Imm, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSVEIncDecImm(MCInst &Inst, unsigned Imm, uint64_t Addr, const MCDisassembler *Decoder)
static DecodeStatus DecodeFixedPointScaleImm32(MCInst &Inst, unsigned Imm, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeTestAndBranch(MCInst &Inst, uint32_t insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSVELogicalImmInstruction(MCInst &Inst, uint32_t insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVecShiftRImm(MCInst &Inst, unsigned Imm, unsigned Add)
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAArch64Disassembler()
static DecodeStatus DecodeVecShiftR64Imm(MCInst &Inst, unsigned Imm, uint64_t Addr, const MCDisassembler *Decoder)
static DecodeStatus DecodeVecShiftLImm(MCInst &Inst, unsigned Imm, unsigned Add)
static DecodeStatus DecodeVecShiftR16ImmNarrow(MCInst &Inst, unsigned Imm, uint64_t Addr, const MCDisassembler *Decoder)
static DecodeStatus DecodePCRelLabel9(MCInst &Inst, unsigned Imm, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSVCROp(MCInst &Inst, unsigned Imm, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeWSeqPairsClassRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Addr, const MCDisassembler *Decoder)
static DecodeStatus DecodeVecShiftR64ImmNarrow(MCInst &Inst, unsigned Imm, uint64_t Addr, const MCDisassembler *Decoder)
static DecodeStatus DecodeZPR4Mul4RegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const void *Decoder)
static DecodeStatus DecodeAddSubImmShift(MCInst &Inst, uint32_t insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMSRSystemRegister(MCInst &Inst, unsigned Imm, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeZPR2Mul2RegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const void *Decoder)
static DecodeStatus DecodeSETMemOpInstruction(MCInst &Inst, uint32_t insn, uint64_t Addr, const MCDisassembler *Decoder)
static DecodeStatus DecodePCRelLabel19(MCInst &Inst, unsigned Imm, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeThreeAddrSRegInstruction(MCInst &Inst, uint32_t insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMemExtend(MCInst &Inst, unsigned Imm, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSignedLdStInstruction(MCInst &Inst, uint32_t insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeExclusiveLdStInstruction(MCInst &Inst, uint32_t insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSyspXzrInstruction(MCInst &Inst, uint32_t insn, uint64_t Addr, const MCDisassembler *Decoder)
static DecodeStatus DecodeFMOVLaneInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static bool isInvalidPState(uint64_t Op1, uint64_t Op2)
static DecodeStatus DecodeSimpleRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMatrixTileListRegisterClass(MCInst &Inst, unsigned RegMask, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeAdrInstruction(MCInst &Inst, uint32_t insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodePRFMRegInstruction(MCInst &Inst, uint32_t insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeVecShiftR16Imm(MCInst &Inst, unsigned Imm, uint64_t Addr, const MCDisassembler *Decoder)
static DecodeStatus DecodeVecShiftR32Imm(MCInst &Inst, unsigned Imm, uint64_t Addr, const MCDisassembler *Decoder)
static DecodeStatus DecodeImm8OptLsl(MCInst &Inst, unsigned Imm, uint64_t Addr, const MCDisassembler *Decoder)
static DecodeStatus DecodeGPRSeqPairsClassRegisterClass(MCInst &Inst, unsigned RegClassID, unsigned RegNo, uint64_t Addr, const MCDisassembler *Decoder)
static DecodeStatus DecodeMRSSystemRegister(MCInst &Inst, unsigned Imm, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeModImmTiedInstruction(MCInst &Inst, uint32_t insn, uint64_t Address, const MCDisassembler *Decoder)
SmallVector< AArch64_IMM::ImmInsnModel, 4 > Insn
#define LLVM_EXTERNAL_VISIBILITY
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
MCDisassembler::DecodeStatus getInstruction(MCInst &Instr, uint64_t &Size, ArrayRef< uint8_t > Bytes, uint64_t Address, raw_ostream &CStream) const override
Returns the disassembly of a single instruction.
uint64_t suggestBytesToSkip(ArrayRef< uint8_t > Bytes, uint64_t Address) const override
Suggest a distance to skip in a buffer of data to find the next place to look for the start of an ins...
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
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
const MCSubtargetInfo & STI
raw_ostream * CommentStream
DecodeStatus
Ternary decode status.
Instances of this class represent a single low-level machine instruction.
unsigned getOpcode() const
void addOperand(const MCOperand Op)
const MCOperand & getOperand(unsigned i) const
Describe properties that are true of each instruction in the target description file.
Instances of this class represent operands of the MCInst class.
static MCOperand createReg(MCRegister Reg)
static MCOperand createImm(int64_t Val)
Generic base class for all target subtargets.
const FeatureBitset & getFeatureBits() const
Symbolize and annotate disassembled instructions.
Wrapper class representing virtual and physical registers.
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
This class implements an extremely fast bulk output stream that can only output to a stream.
const char *(* LLVMSymbolLookupCallback)(void *DisInfo, uint64_t ReferenceValue, uint64_t *ReferenceType, uint64_t ReferencePC, const char **ReferenceName)
The type for the symbol lookup function.
int(* LLVMOpInfoCallback)(void *DisInfo, uint64_t PC, uint64_t Offset, uint64_t OpSize, uint64_t InstSize, int TagType, void *TagBuf)
The type for the operand information call back function.
static bool isValidDecodeLogicalImmediate(uint64_t val, unsigned regSize)
isValidDecodeLogicalImmediate - Check to see if the logical immediate value in the form "N:immr:imms"...
This is an optimization pass for GlobalISel generic memory operations.
Target & getTheAArch64beTarget()
Target & getTheAArch64leTarget()
Target & getTheAArch64_32Target()
Target & getTheARM64_32Target()
Target & getTheARM64Target()
Description of the encoding of one expression Op.
static void RegisterMCSymbolizer(Target &T, Target::MCSymbolizerCtorTy Fn)
RegisterMCSymbolizer - Register an MCSymbolizer implementation for the given target.
static void RegisterMCDisassembler(Target &T, Target::MCDisassemblerCtorTy Fn)
RegisterMCDisassembler - Register a MCDisassembler implementation for the given target.