35#define DEBUG_TYPE "asm-printer"
37#define PRINT_ALIAS_INSTR
38#include "ARMGenAsmWriter.inc"
45 assert((imm & ~0x1f) == 0 &&
"Invalid shift encoding");
59 O << getShiftOpcStr(ShOpc);
73 if (Opt ==
"reg-names-std") {
74 DefaultAltIdx = ARM::NoRegAltName;
77 if (Opt ==
"reg-names-raw") {
78 DefaultAltIdx = ARM::RegNamesRaw;
91 unsigned Opcode =
MI->getOpcode();
96 O <<
'\t' <<
"vlldm" <<
'\t';
102 case ARM::VLLDM_T2: {
104 O <<
'\t' <<
"vlldm" <<
'\t';
112 O <<
'\t' <<
"vlstm" <<
'\t';
118 case ARM::VLSTM_T2: {
120 O <<
'\t' <<
"vlstm" <<
'\t';
179 case ARM::t2STMDB_UPD:
180 if (
MI->getOperand(0).getReg() == ARM::SP &&
MI->getNumOperands() > 5) {
184 if (Opcode == ARM::t2STMDB_UPD)
193 case ARM::STR_PRE_IMM:
194 if (
MI->getOperand(2).getReg() == ARM::SP &&
195 MI->getOperand(3).getImm() == -4) {
208 case ARM::t2LDMIA_UPD:
209 if (
MI->getOperand(0).getReg() == ARM::SP &&
MI->getNumOperands() > 5) {
213 if (Opcode == ARM::t2LDMIA_UPD)
222 case ARM::LDR_POST_IMM:
223 if (
MI->getOperand(2).getReg() == ARM::SP &&
224 MI->getOperand(4).getImm() == 4) {
236 case ARM::VSTMSDB_UPD:
237 case ARM::VSTMDDB_UPD:
238 if (
MI->getOperand(0).getReg() == ARM::SP) {
239 O <<
'\t' <<
"vpush";
249 case ARM::VLDMSIA_UPD:
250 case ARM::VLDMDIA_UPD:
251 if (
MI->getOperand(0).getReg() == ARM::SP) {
262 bool Writeback =
true;
263 unsigned BaseReg =
MI->getOperand(0).getReg();
264 for (
unsigned i = 3; i <
MI->getNumOperands(); ++i) {
265 if (
MI->getOperand(i).getReg() == BaseReg)
293 bool isStore = Opcode == ARM::STREXD || Opcode == ARM::STLEXD;
294 unsigned Reg =
MI->getOperand(
isStore ? 1 : 0).getReg();
307 for (
unsigned i =
isStore ? 3 : 2; i <
MI->getNumOperands(); ++i)
319 switch (
MI->getOperand(0).getImm()) {
345 unsigned Reg =
Op.getReg();
347 }
else if (
Op.isImm()) {
350 assert(
Op.isExpr() &&
"unknown operand kind in printOperand");
362 int64_t TargetAddress;
363 if (!
Constant->evaluateAsAbsolute(TargetAddress)) {
368 O.write_hex(
static_cast<uint32_t>(TargetAddress));
407 int32_t OffImm = (int32_t)MO1.
getImm();
408 bool isSub = OffImm < 0;
411 if (OffImm == INT32_MIN)
570 bool AlwaysPrintImm0) {
597template <
bool AlwaysPr
intImm0>
609 "unexpected idxmode");
636 unsigned Imm = MO.
getImm();
638 <<
'#' << ((Imm & 256) ?
"" :
"-") << (Imm & 0xff);
647 O << (MO2.
getImm() ?
"" :
"-");
655 unsigned Imm = MO.
getImm();
657 <<
'#' << ((Imm & 256) ?
"" :
"-") << ((Imm & 0xff) << 2);
687template <
bool AlwaysPr
intImm0>
713template <
bool AlwaysPr
intImm0>
750 O <<
":" << (MO2.
getImm() << 3);
786 assert(MO.
isImm() &&
"Not a valid bf_inv_mask_imm value!");
795 unsigned val =
MI->getOperand(OpNum).getImm();
802 unsigned val =
MI->getOperand(OpNum).getImm();
809 unsigned val =
MI->getOperand(OpNum).getImm();
816 unsigned ShiftOp =
MI->getOperand(OpNum).getImm();
817 bool isASR = (ShiftOp & (1 << 5)) != 0;
818 unsigned Amt = ShiftOp & 0x1f;
831 unsigned Imm =
MI->getOperand(OpNum).getImm();
834 assert(Imm > 0 && Imm < 32 &&
"Invalid PKH shift immediate value!");
842 unsigned Imm =
MI->getOperand(OpNum).getImm();
846 assert(Imm > 0 && Imm <= 32 &&
"Invalid PKH shift immediate value!");
854 if (
MI->getOpcode() != ARM::t2CLRM) {
863 for (
unsigned i = OpNum, e =
MI->getNumOperands(); i != e; ++i) {
874 unsigned Reg =
MI->getOperand(OpNum).getReg();
899 unsigned IFlags =
Op.getImm();
900 for (
int i = 2; i >= 0; --i)
901 if (IFlags & (1 << i))
913 if (FeatureBits[ARM::FeatureMClass]) {
915 unsigned SYSm =
Op.getImm() & 0xFFF;
916 unsigned Opcode =
MI->getOpcode();
919 if (Opcode == ARM::t2MSR_M && FeatureBits[ARM::FeatureDSP]) {
921 if (TheReg && TheReg->isInRequiredFeatures({ARM::FeatureDSP})) {
929 if (Opcode == ARM::t2MSR_M && FeatureBits [ARM::HasV7Ops]) {
952 unsigned SpecRegRBit =
Op.getImm() >> 4;
953 unsigned Mask =
Op.getImm() & 0xf;
955 if (!SpecRegRBit && (Mask == 8 || Mask == 4 || Mask == 12)) {
993 uint32_t Banked =
MI->getOperand(OpNum).getImm();
994 auto TheReg = ARMBankedReg::lookupBankedRegByEncoding(Banked);
995 assert(TheReg &&
"invalid banked register operand");
996 std::string
Name = TheReg->Name;
998 uint32_t isSPSR = (Banked & 0x20) >> 5;
1000 Name.replace(0, 4,
"SPSR");
1009 if ((
unsigned)
CC == 15)
1043 if (
MI->getOperand(OpNum).getReg()) {
1044 assert(
MI->getOperand(OpNum).getReg() == ARM::CPSR &&
1045 "Expect ARM CPSR register!");
1053 O <<
MI->getOperand(OpNum).getImm();
1059 O <<
"p" <<
MI->getOperand(OpNum).getImm();
1065 O <<
"c" <<
MI->getOperand(OpNum).getImm();
1071 O <<
"{" <<
MI->getOperand(OpNum).getImm() <<
"}";
1079template <
unsigned scale>
1093 if (OffImm == INT32_MIN)
1095 else if (OffImm < 0)
1096 O <<
"#-" << -OffImm;
1105 <<
"#" <<
formatImm(
MI->getOperand(OpNum).getImm() * 4);
1111 unsigned Imm =
MI->getOperand(OpNum).getImm();
1119 unsigned Mask =
MI->getOperand(OpNum).getImm();
1121 assert(NumTZ <= 3 &&
"Invalid IT mask!");
1122 for (
unsigned Pos = 3, e = NumTZ; Pos > e; --Pos) {
1123 if ((Mask >> Pos) & 1)
1144 if (
unsigned RegNum = MO2.
getReg()) {
1167 if (
unsigned ImmOffs = MO2.
getImm()) {
1211 unsigned Reg = MO1.
getReg();
1215 assert(MO2.
isImm() &&
"Not a valid t2_so_reg value!");
1220template <
bool AlwaysPr
intImm0>
1236 int32_t OffImm = (int32_t)MO2.
getImm();
1237 bool isSub = OffImm < 0;
1239 if (OffImm == INT32_MIN)
1244 }
else if (AlwaysPrintImm0 || OffImm > 0) {
1251template <
bool AlwaysPr
intImm0>
1263 int32_t OffImm = (int32_t)MO2.
getImm();
1264 bool isSub = OffImm < 0;
1266 if (OffImm == INT32_MIN)
1271 }
else if (AlwaysPrintImm0 || OffImm > 0) {
1278template <
bool AlwaysPr
intImm0>
1295 int32_t OffImm = (int32_t)MO2.
getImm();
1296 bool isSub = OffImm < 0;
1298 assert(((OffImm & 0x3) == 0) &&
"Not a valid immediate!");
1301 if (OffImm == INT32_MIN)
1306 }
else if (AlwaysPrintImm0 || OffImm > 0) {
1333 int32_t OffImm = (int32_t)MO1.
getImm();
1336 if (OffImm == INT32_MIN)
1338 else if (OffImm < 0)
1339 O <<
"#-" << -OffImm;
1348 int32_t OffImm = (int32_t)MO1.
getImm();
1350 assert(((OffImm & 0x3) == 0) &&
"Not a valid immediate!");
1354 if (OffImm == INT32_MIN)
1356 else if (OffImm < 0)
1357 O <<
"#-" << -OffImm;
1374 assert(MO2.
getReg() &&
"Invalid so_reg load / store address!");
1378 unsigned ShAmt = MO3.
getImm();
1380 assert(ShAmt <= 3 &&
"Not a valid Thumb2 addressing mode!");
1397 unsigned EncodedImm =
MI->getOperand(OpNum).getImm();
1409 unsigned Imm =
MI->getOperand(OpNum).getImm();
1416 unsigned Imm =
MI->getOperand(OpNum).getImm();
1419 assert(Imm <= 3 &&
"illegal ror immediate!");
1433 unsigned Bits =
Op.getImm() & 0xFF;
1434 unsigned Rot = (
Op.getImm() & 0xF00) >> 7;
1436 bool PrintUnsigned =
false;
1437 switch (
MI->getOpcode()) {
1440 PrintUnsigned = (
MI->getOperand(OpNum - 1).getReg() == ARM::PC);
1444 PrintUnsigned =
true;
1448 int32_t Rotated = llvm::rotr<uint32_t>(Bits, Rot);
1479 O <<
"[" <<
MI->getOperand(OpNum).getImm() <<
"]";
1493 unsigned Reg =
MI->getOperand(OpNum).getReg();
1506 unsigned Reg =
MI->getOperand(OpNum).getReg();
1561 unsigned Reg =
MI->getOperand(OpNum).getReg();
1608 unsigned Reg =
MI->getOperand(OpNum).getReg();
1683template<
unsigned NumRegs>
1687 unsigned Reg =
MI->getOperand(OpNum).getReg();
1688 const char *Prefix =
"{";
1689 for (
unsigned i = 0; i < NumRegs; i++) {
1697template<
int64_t Angle,
int64_t Remainder>
1701 unsigned Val =
MI->getOperand(OpNo).getImm();
1702 O <<
"#" << (Val * Angle) + Remainder;
1717 unsigned Mask =
MI->getOperand(OpNum).getImm();
1719 assert(NumTZ <= 3 &&
"Invalid VPT mask!");
1720 for (
unsigned Pos = 3, e = NumTZ; Pos > e; --Pos) {
1721 bool T = ((Mask >> Pos) & 1) == 0;
1732 uint32_t Val =
MI->getOperand(OpNum).getImm();
1733 assert(Val <= 1 &&
"Invalid MVE saturate operand");
1734 O <<
"#" << (Val == 1 ? 48 : 64);
unsigned const MachineRegisterInfo * MRI
static bool isStore(int Opcode)
static void printRegImmShift(raw_ostream &O, ARM_AM::ShiftOpc ShOpc, unsigned ShImm, const ARMInstPrinter &printer)
static unsigned translateShiftImm(unsigned imm)
translateShiftImm - Convert shift immediate from 0-31 to 1-32 for printing.
static uint64_t scale(uint64_t Num, uint32_t N, uint32_t D)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void printT2AddrModeImm0_1020s4Operand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printMVEVectorList(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printVectorListTwoAllLanes(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printCPSIFlag(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printSBitModifierOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printVectorListFour(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printThumbAddrModeImm5S1Operand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printPKHASRShiftImm(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printVPTPredicateOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printInstSyncBOption(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printAddrMode7Operand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printRegisterList(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printOperand(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
void printSORegRegOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printComplexRotationOp(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printMveSaturateOp(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printVectorListTwo(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printFBits16(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
ARMInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
void printAM2PreOrOffsetIndexOp(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printPCLabel(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printAddrMode3OffsetOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printCPSIMod(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printRegName(raw_ostream &OS, MCRegister Reg) const override
Print the assembler register name.
void printVectorListTwoSpaced(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printT2AddrModeImm8Operand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
bool applyTargetSpecificCLOption(StringRef Opt) override
Customize the printer according to a command line option.
virtual bool printAliasInstr(const MCInst *MI, uint64_t Address, const MCSubtargetInfo &STI, raw_ostream &O)
void printThumbAddrModeImm5S4Operand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printAddrMode3Operand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printMveAddrModeRQOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printThumbLdrLabelOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printVectorListTwoSpacedAllLanes(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printT2SOOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printAddrModeTBB(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printVectorListOne(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printThumbITMask(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printPostIdxImm8Operand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printAddrMode6OffsetOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printAddrMode5Operand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printVectorListThreeSpaced(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printImmPlusOneOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printTraceSyncBOption(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printInstruction(const MCInst *MI, uint64_t Address, const MCSubtargetInfo &STI, raw_ostream &O)
void printPredicateOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printAddrMode2Operand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printGPRPairOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printT2AddrModeImm8s4OffsetOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printThumbAddrModeSPOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printVectorListFourAllLanes(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printBitfieldInvMaskImmOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printPostIdxImm8s4Operand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printCImmediate(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printFBits32(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printVectorListThreeAllLanes(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printRotImmOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printMandatoryPredicateOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printMemBOption(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printVectorListThreeSpacedAllLanes(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printInst(const MCInst *MI, uint64_t Address, StringRef Annot, const MCSubtargetInfo &STI, raw_ostream &O) override
Print the specified MCInst to the specified raw_ostream.
void printPostIdxRegOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
static const char * getRegisterName(MCRegister Reg, unsigned AltIdx=ARM::NoRegAltName)
void printFPImmOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printT2AddrModeImm8OffsetOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printCoprocOptionImm(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printThumbAddrModeRROperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printT2AddrModeSoRegOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printShiftImmOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printMSRMaskOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printT2AddrModeImm8s4Operand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printSORegImmOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printPKHLSLShiftImm(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printBankedRegOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printThumbSRImm(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printModImmOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printSetendOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printVectorListOneAllLanes(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printThumbAddrModeImm5S2Operand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printAddrMode2OffsetOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printAddrMode6Operand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printMandatoryRestrictedPredicateOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printVectorListFourSpacedAllLanes(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printPImmediate(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printThumbS4ImmOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printVPTMask(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printVectorListThree(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printVectorListFourSpaced(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printVMOVModImmOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printAdrLabelOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printAddrModeImm12Operand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printAM3PreOrOffsetIndexOp(const MCInst *MI, unsigned Op, raw_ostream &O, bool AlwaysPrintImm0)
void printThumbAddrModeImm5SOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O, unsigned Scale)
void printAddrModeTBH(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printNoHashImmediate(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printVectorIndex(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printLdStmModeOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printAddrMode5FP16Operand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
void printMandatoryInvertedPredicateOperand(const MCInst *MI, unsigned OpNum, const MCSubtargetInfo &STI, raw_ostream &O)
This is an important base class in LLVM.
This class represents an Operation in the Expression.
Container class for subtarget features.
This class is intended to be used as a base class for asm properties and features specific to the tar...
Base class for the full range of assembler expressions which are needed for parsing.
@ Constant
Constant expressions.
@ Binary
Binary expressions.
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
format_object< int64_t > formatHex(int64_t Value) const
raw_ostream * CommentStream
A stream that comments can be emitted to if desired.
WithMarkup markup(raw_ostream &OS, Markup M) const
const MCRegisterInfo & MRI
void printAnnotation(raw_ostream &OS, StringRef Annot)
Utility function for printing annotations.
format_object< int64_t > formatImm(int64_t Value) const
Utility function to print immediates in decimal or hex.
bool getUseMarkup() const
bool PrintBranchImmAsAddress
If true, a branch immediate (e.g.
Instances of this class represent a single low-level machine instruction.
void addOperand(const MCOperand Op)
void setOpcode(unsigned Op)
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(unsigned Reg)
unsigned getReg() const
Returns the register number.
const MCExpr * getExpr() const
MCRegisterClass - Base class of TargetRegisterClass.
bool contains(MCRegister Reg) const
contains - Return true if the specified register is included in this register class.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
MCRegister getMatchingSuperReg(MCRegister Reg, unsigned SubIdx, const MCRegisterClass *RC) const
Return a super-register of the specified register Reg so its sub-register of index SubIdx is Reg.
uint16_t getEncodingValue(MCRegister RegNo) const
Returns the encoding for RegNo.
const MCRegisterClass & getRegClass(unsigned i) const
Returns the register class associated with the enumeration value.
MCRegister getSubReg(MCRegister Reg, unsigned Idx) const
Returns the physical register number of sub-register "Index" for physical register RegNo.
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
StringRef - Represent a constant reference to a string, i.e.
Target - Wrapper for Target specific information.
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.
static CondCodes getOppositeCondition(CondCodes CC)
const MClassSysReg * lookupMClassSysRegBy8bitSYSmValue(unsigned SYSm)
const MClassSysReg * lookupMClassSysRegAPSRNonDeprecated(unsigned SYSm)
const MClassSysReg * lookupMClassSysRegBy12bitSYSmValue(unsigned SYSm)
unsigned char getAM3Offset(unsigned AM3Opc)
unsigned char getAM5FP16Offset(unsigned AM5Opc)
unsigned getSORegOffset(unsigned Op)
int getSOImmVal(unsigned Arg)
getSOImmVal - Given a 32-bit immediate, if it is something that can fit into an shifter_operand immed...
ShiftOpc getAM2ShiftOpc(unsigned AM2Opc)
uint64_t decodeVMOVModImm(unsigned ModImm, unsigned &EltBits)
decodeVMOVModImm - Decode a NEON/MVE modified immediate value into the element value and the element ...
unsigned getAM2IdxMode(unsigned AM2Opc)
unsigned getAM3IdxMode(unsigned AM3Opc)
unsigned getAM2Offset(unsigned AM2Opc)
const char * getAMSubModeStr(AMSubMode Mode)
float getFPImmFloat(unsigned Imm)
ShiftOpc getSORegShOp(unsigned Op)
AddrOpc getAM5Op(unsigned AM5Opc)
AddrOpc getAM5FP16Op(unsigned AM5Opc)
const char * getAddrOpcStr(AddrOpc Op)
unsigned char getAM5Offset(unsigned AM5Opc)
const StringRef getShiftOpcStr(ShiftOpc Op)
AddrOpc getAM2Op(unsigned AM2Opc)
AddrOpc getAM3Op(unsigned AM3Opc)
AMSubMode getAM4SubMode(unsigned Mode)
static const char * InstSyncBOptToString(unsigned val)
static const char * MemBOptToString(unsigned val, bool HasV8)
uint64_t evaluateBranchTarget(const MCInstrDesc &InstDesc, uint64_t Addr, int64_t Imm)
static const char * IModToString(unsigned val)
static const char * IFlagsToString(unsigned val)
static const char * TraceSyncBOptToString(unsigned val)
This is an optimization pass for GlobalISel generic memory operations.
auto drop_begin(T &&RangeOrContainer, size_t N=1)
Return a range covering RangeOrContainer with the first N elements excluded.
static const char * ARMVPTPredToString(ARMVCC::VPTCodes CC)
int bit_width(T Value)
Returns the number of bits needed to represent Value if Value is nonzero.
int countr_zero(T Val)
Count number of 0's from the least significant bit to the most stopping at the first 1.
bool is_sorted(R &&Range, Compare C)
Wrapper function around std::is_sorted to check if elements in a range R are sorted with respect to a...
static const char * ARMCondCodeToString(ARMCC::CondCodes CC)