LLVM 20.0.0git
|
#include "Target/AArch64/MCTargetDesc/AArch64InstPrinter.h"
Public Member Functions | |
AArch64InstPrinter (const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI) | |
bool | applyTargetSpecificCLOption (StringRef Opt) override |
Customize the printer according to a command line option. | |
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 | printRegName (raw_ostream &OS, MCRegister Reg) const override |
Print the assembler register name. | |
void | printRegName (raw_ostream &OS, MCRegister Reg, unsigned AltIdx) const |
std::pair< const char *, uint64_t > | getMnemonic (const MCInst *MI) override |
Returns a pair containing the mnemonic for MI and the number of bits left for further processing by printInstruction (generated by tablegen). | |
virtual void | printInstruction (const MCInst *MI, uint64_t Address, const MCSubtargetInfo &STI, raw_ostream &O) |
virtual bool | printAliasInstr (const MCInst *MI, uint64_t Address, const MCSubtargetInfo &STI, raw_ostream &O) |
virtual void | printCustomAliasOperand (const MCInst *MI, uint64_t Address, unsigned OpIdx, unsigned PrintMethodIdx, const MCSubtargetInfo &STI, raw_ostream &O) |
virtual StringRef | getRegName (MCRegister Reg) const |
Public Member Functions inherited from llvm::MCInstPrinter | |
MCInstPrinter (const MCAsmInfo &mai, const MCInstrInfo &mii, const MCRegisterInfo &mri) | |
virtual | ~MCInstPrinter () |
virtual bool | applyTargetSpecificCLOption (StringRef Opt) |
Customize the printer according to a command line option. | |
void | setCommentStream (raw_ostream &OS) |
Specify a stream to emit comments to. | |
virtual std::pair< const char *, uint64_t > | getMnemonic (const MCInst *MI)=0 |
Returns a pair containing the mnemonic for MI and the number of bits left for further processing by printInstruction (generated by tablegen). | |
virtual void | printInst (const MCInst *MI, uint64_t Address, StringRef Annot, const MCSubtargetInfo &STI, raw_ostream &OS)=0 |
Print the specified MCInst to the specified raw_ostream. | |
StringRef | getOpcodeName (unsigned Opcode) const |
Return the name of the specified opcode enum (e.g. | |
virtual void | printRegName (raw_ostream &OS, MCRegister Reg) const |
Print the assembler register name. | |
bool | getUseMarkup () const |
void | setUseMarkup (bool Value) |
bool | getUseColor () const |
void | setUseColor (bool Value) |
WithMarkup | markup (raw_ostream &OS, Markup M) const |
bool | getPrintImmHex () const |
void | setPrintImmHex (bool Value) |
void | setPrintHexStyle (HexStyle::Style Value) |
void | setPrintBranchImmAsAddress (bool Value) |
void | setSymbolizeOperands (bool Value) |
void | setMCInstrAnalysis (const MCInstrAnalysis *Value) |
format_object< int64_t > | formatImm (int64_t Value) const |
Utility function to print immediates in decimal or hex. | |
format_object< int64_t > | formatDec (int64_t Value) const |
Utility functions to print decimal/hexadecimal values. | |
format_object< int64_t > | formatHex (int64_t Value) const |
format_object< uint64_t > | formatHex (uint64_t Value) const |
Static Public Member Functions | |
static const char * | getRegisterName (MCRegister Reg, unsigned AltIdx=AArch64::NoRegAltName) |
Additional Inherited Members | |
Public Types inherited from llvm::MCInstPrinter | |
enum class | Markup { Immediate , Register , Target , Memory } |
Protected Attributes inherited from llvm::MCInstPrinter | |
raw_ostream * | CommentStream = nullptr |
A stream that comments can be emitted to if desired. | |
const MCAsmInfo & | MAI |
const MCInstrInfo & | MII |
const MCRegisterInfo & | MRI |
const MCInstrAnalysis * | MIA = nullptr |
bool | UseMarkup = false |
True if we are printing marked up assembly. | |
bool | UseColor = false |
True if we are printing colored assembly. | |
bool | PrintAliases = true |
True if we prefer aliases (e.g. nop) to raw mnemonics. | |
bool | PrintImmHex = false |
True if we are printing immediates as hex. | |
HexStyle::Style | PrintHexStyle = HexStyle::C |
Which style to use for printing hexadecimal values. | |
bool | PrintBranchImmAsAddress = false |
If true, a branch immediate (e.g. | |
bool | SymbolizeOperands = false |
If true, symbolize branch target and memory reference operands. | |
Definition at line 23 of file AArch64InstPrinter.h.
AArch64InstPrinter::AArch64InstPrinter | ( | const MCAsmInfo & | MAI, |
const MCInstrInfo & | MII, | ||
const MCRegisterInfo & | MRI | ||
) |
Definition at line 44 of file AArch64InstPrinter.cpp.
Customize the printer according to a command line option.
Reimplemented from llvm::MCInstPrinter.
Definition at line 54 of file AArch64InstPrinter.cpp.
References llvm::MCInstPrinter::PrintAliases.
|
overridevirtual |
Returns a pair containing the mnemonic for MI
and the number of bits left for further processing by printInstruction (generated by tablegen).
Implements llvm::MCInstPrinter.
Reimplemented in llvm::AArch64AppleInstPrinter.
|
static |
|
virtual |
Reimplemented in llvm::AArch64AppleInstPrinter.
Definition at line 71 of file AArch64InstPrinter.cpp.
References getRegisterName().
|
protected |
Definition at line 1213 of file AArch64InstPrinter.cpp.
References assert(), llvm::MCInstPrinter::CommentStream, llvm::MCInstPrinter::formatImm(), llvm::MCOperand::getExpr(), llvm::MCOperand::getImm(), llvm::AArch64_AM::getShiftValue(), llvm::MCInstPrinter::Immediate, llvm::MCOperand::isExpr(), llvm::MCOperand::isImm(), llvm::MCInstPrinter::MAI, llvm::MCInstPrinter::markup(), MI, llvm::MCExpr::print(), and printShifter().
|
protected |
Definition at line 1799 of file AArch64InstPrinter.cpp.
References llvm::Address, llvm::MCInstPrinter::formatHex(), llvm::MCInstPrinter::Immediate, llvm::MCInstPrinter::MAI, llvm::MCInstPrinter::markup(), MI, llvm::Offset, llvm::Pass::print(), llvm::MCInstPrinter::PrintBranchImmAsAddress, and llvm::MCInstPrinter::Target.
|
virtual |
Reimplemented in llvm::AArch64AppleInstPrinter.
Referenced by printInst().
|
protected |
Definition at line 1770 of file AArch64InstPrinter.cpp.
References llvm::Address, llvm::MCInstPrinter::formatHex(), llvm::MCInstPrinter::formatImm(), llvm::MCInstPrinter::Immediate, llvm::MCInstPrinter::MAI, llvm::MCInstPrinter::markup(), MI, llvm::Offset, llvm::Pass::print(), llvm::MCInstPrinter::PrintBranchImmAsAddress, and llvm::MCInstPrinter::Target.
|
inlineprotected |
Definition at line 124 of file AArch64InstPrinter.h.
References llvm::BitWidth, MI, and printAMIndexedWB().
|
protected |
Definition at line 1425 of file AArch64InstPrinter.cpp.
References assert(), llvm::MCInstPrinter::formatImm(), llvm::MCOperand::getExpr(), llvm::MCOperand::getImm(), llvm::MCInstPrinter::Immediate, llvm::MCOperand::isExpr(), llvm::MCOperand::isImm(), llvm::MCInstPrinter::MAI, llvm::MCInstPrinter::markup(), MI, llvm::MCExpr::print(), and printRegName().
Referenced by printAMIndexedWB().
|
protected |
Definition at line 1389 of file AArch64InstPrinter.cpp.
References MI, and printRegName().
|
protected |
Definition at line 1272 of file AArch64InstPrinter.cpp.
References llvm::AArch64_AM::getArithExtendType(), llvm::AArch64_AM::getArithShiftValue(), llvm::AArch64_AM::getShiftExtendName(), llvm::MCInstPrinter::Immediate, llvm::MCInstPrinter::markup(), MI, llvm::AArch64_AM::UXTW, and llvm::AArch64_AM::UXTX.
Referenced by printExtendedRegister().
|
protected |
Definition at line 1848 of file AArch64InstPrinter.cpp.
References assert(), llvm::MCInstPrinter::Immediate, llvm::MCInstPrinter::markup(), MI, and Name.
|
protected |
Definition at line 1825 of file AArch64InstPrinter.cpp.
References llvm::MCInstPrinter::Immediate, llvm::MCInstPrinter::markup(), MI, and Name.
|
protected |
Definition at line 1485 of file AArch64InstPrinter.cpp.
References llvm::MCInstPrinter::formatImm(), llvm::MCInstPrinter::Immediate, llvm::MCInstPrinter::markup(), and MI.
|
protected |
Definition at line 1964 of file AArch64InstPrinter.cpp.
References llvm::MCInstPrinter::Immediate, llvm::MCInstPrinter::markup(), and MI.
|
protected |
Definition at line 1375 of file AArch64InstPrinter.cpp.
References CC, llvm::AArch64CC::getCondCodeName(), and MI.
|
virtual |
Reimplemented in llvm::AArch64AppleInstPrinter.
|
protected |
Definition at line 2098 of file AArch64InstPrinter.cpp.
References llvm::MCInstPrinter::Immediate, llvm::MCInstPrinter::markup(), and MI.
|
protected |
Definition at line 1265 of file AArch64InstPrinter.cpp.
References MI, printArithExtend(), and printRegName().
|
protected |
Definition at line 1496 of file AArch64InstPrinter.cpp.
References llvm::format(), llvm::MCOperand::getDFPImm(), llvm::AArch64_AM::getFPImmFloat(), llvm::MCOperand::getImm(), llvm::MCInstPrinter::Immediate, llvm::MCOperand::isDFPImm(), llvm::MCInstPrinter::markup(), and MI.
|
protected |
Definition at line 2108 of file AArch64InstPrinter.cpp.
References llvm::getWRegFromXReg(), MI, and printRegName().
|
protected |
Definition at line 2115 of file AArch64InstPrinter.cpp.
References llvm::MCRegisterInfo::getSubReg(), MI, llvm::MCInstPrinter::MRI, and printRegName().
|
protected |
Definition at line 1605 of file AArch64InstPrinter.cpp.
References llvm::MCRegisterInfo::getSubReg(), MI, llvm::MCInstPrinter::MRI, printRegName(), and llvm::size().
|
protected |
Definition at line 1156 of file AArch64InstPrinter.cpp.
References llvm::MCInstPrinter::formatImm(), llvm::MCInstPrinter::Immediate, llvm::MCInstPrinter::markup(), and MI.
Referenced by printOperand().
|
protected |
Definition at line 2036 of file AArch64InstPrinter.cpp.
References assert(), llvm::MCInstPrinter::formatImm(), llvm::AArch64_AM::getShiftType(), llvm::AArch64_AM::getShiftValue(), llvm::MCInstPrinter::Immediate, llvm::AArch64_AM::LSL, llvm::MCInstPrinter::markup(), MI, printImmSVE(), and printShifter().
|
protected |
Definition at line 1163 of file AArch64InstPrinter.cpp.
References llvm::format(), llvm::MCInstPrinter::Immediate, llvm::MCInstPrinter::markup(), and MI.
|
protected |
Definition at line 1406 of file AArch64InstPrinter.cpp.
References llvm::MCInstPrinter::formatImm(), MI, and llvm::Offset.
|
protected |
Definition at line 1398 of file AArch64InstPrinter.cpp.
References llvm::MCInstPrinter::formatImm(), llvm::MCInstPrinter::Immediate, llvm::MCInstPrinter::markup(), and MI.
|
protected |
Definition at line 2018 of file AArch64InstPrinter.cpp.
References llvm::MCInstPrinter::CommentStream, llvm::MCInstPrinter::formatDec(), llvm::MCInstPrinter::formatHex(), llvm::MCInstPrinter::getPrintImmHex(), llvm::MCInstPrinter::Immediate, and llvm::MCInstPrinter::markup().
Referenced by printImm8OptLsl(), and printSVELogicalImm().
|
protected |
Print a list of vector registers where the type suffix is implicit (i.e.
attached to the instruction rather than the registers).
Definition at line 1732 of file AArch64InstPrinter.cpp.
References MI, and printVectorList().
|
overridevirtual |
Print the specified MCInst to the specified raw_ostream.
Address
the address of current instruction on most targets, used to print a PC relative immediate as the target address. On targets where a PC relative immediate is relative to the next instruction and the length of a MCInst is difficult to measure (e.g. x86), this is the address of the next instruction. If Address is 0, the immediate will be printed.
Implements llvm::MCInstPrinter.
Reimplemented in llvm::AArch64AppleInstPrinter.
Definition at line 75 of file AArch64InstPrinter.cpp.
References llvm::Address, llvm::atomicBarrierDroppedOnZero(), llvm::BitWidth, llvm::MCInstPrinter::CommentStream, llvm::AArch64_AM::decodeLogicalImmediate(), llvm::MCInstPrinter::formatDec(), llvm::MCInstPrinter::formatHex(), llvm::MCInstPrinter::formatImm(), llvm::MCAsmInfo::getCommentString(), llvm::MCOperand::getImm(), llvm::MCInstPrinter::getPrintImmHex(), llvm::MCOperand::getReg(), llvm::getWRegFromXReg(), llvm::MCSubtargetInfo::hasFeature(), llvm::MCInstPrinter::Immediate, llvm::AArch64_AM::isAnyMOVWMovAlias(), llvm::MCOperand::isImm(), llvm::AArch64_AM::isMOVNMovAlias(), llvm::AArch64_AM::isMOVZMovAlias(), llvm::MCInstPrinter::MAI, llvm::MCInstPrinter::markup(), MI, llvm::Pass::print(), llvm::MCInstPrinter::PrintAliases, printAliasInstr(), llvm::MCInstPrinter::printAnnotation(), printInstruction(), printRangePrefetchAlias(), printRegName(), printSysAlias(), printSyspAlias(), and llvm::SignExtend64().
Referenced by llvm::AArch64AppleInstPrinter::printInst().
|
virtual |
Reimplemented in llvm::AArch64AppleInstPrinter.
Referenced by printInst().
|
protected |
Definition at line 1382 of file AArch64InstPrinter.cpp.
References CC, llvm::AArch64CC::getCondCodeName(), llvm::AArch64CC::getInvertedCondCode(), and MI.
|
protected |
Definition at line 1236 of file AArch64InstPrinter.cpp.
References llvm::AArch64_AM::decodeLogicalImmediate(), llvm::MCInstPrinter::Immediate, llvm::MCInstPrinter::markup(), and MI.
|
protected |
Definition at line 1078 of file AArch64InstPrinter.cpp.
References assert(), llvm::MCOperand::getReg(), llvm::MCOperand::isReg(), llvm_unreachable, MI, and printRegName().
|
protected |
Definition at line 1764 of file AArch64InstPrinter.cpp.
References MI.
|
protected |
Definition at line 1122 of file AArch64InstPrinter.cpp.
References assert(), llvm::MCOperand::getReg(), llvm::MCOperand::isReg(), MI, and printRegName().
|
protected |
Definition at line 1623 of file AArch64InstPrinter.cpp.
References I, MI, and printRegName().
|
protected |
Definition at line 1109 of file AArch64InstPrinter.cpp.
References assert(), llvm::sampleprof::Base, llvm::MCOperand::getReg(), getRegisterName(), llvm::MCOperand::isReg(), MI, and RegName.
|
inlineprotected |
Definition at line 99 of file AArch64InstPrinter.h.
References MI, and printMemExtend().
|
protected |
Definition at line 1319 of file AArch64InstPrinter.cpp.
References MI, and printMemExtendImpl().
Referenced by printMemExtend().
|
protected |
Definition at line 1303 of file AArch64InstPrinter.cpp.
References llvm::MCInstPrinter::Immediate, llvm::Log2_32(), and llvm::MCInstPrinter::markup().
Referenced by printMemExtend(), and printRegWithShiftExtend().
|
protected |
Definition at line 1886 of file AArch64InstPrinter.cpp.
References llvm::AArch64SysReg::genericRegisterString(), isValidSysReg(), lookupSysReg(), and MI.
|
protected |
Definition at line 1913 of file AArch64InstPrinter.cpp.
References llvm::AArch64SysReg::genericRegisterString(), isValidSysReg(), lookupSysReg(), and MI.
|
protected |
Definition at line 1141 of file AArch64InstPrinter.cpp.
References assert(), llvm::MCInstPrinter::MAI, MI, llvm::DWARFExpression::Operation::print(), printImm(), and printRegName().
Referenced by printRangePrefetchAlias(), and printRegWithShiftExtend().
|
inlineprotected |
Definition at line 72 of file AArch64InstPrinter.h.
References MI, and printPostIncOperand().
|
protected |
Definition at line 1183 of file AArch64InstPrinter.cpp.
References llvm::MCInstPrinter::Immediate, llvm_unreachable, llvm::MCInstPrinter::markup(), MI, and printRegName().
Referenced by printPostIncOperand().
|
protected |
Definition at line 1346 of file AArch64InstPrinter.cpp.
References llvm_unreachable, and MI.
|
protected |
Definition at line 1454 of file AArch64InstPrinter.cpp.
References llvm::MCInstPrinter::formatImm(), llvm::MCSubtargetInfo::getFeatureBits(), llvm::MCInstPrinter::Immediate, llvm::MCInstPrinter::markup(), and MI.
|
protected |
Definition at line 1474 of file AArch64InstPrinter.cpp.
References llvm::MCInstPrinter::formatImm(), llvm::MCInstPrinter::Immediate, llvm::MCInstPrinter::markup(), and MI.
|
protected |
Definition at line 847 of file AArch64InstPrinter.cpp.
References assert(), llvm::MCRegisterClass::contains(), llvm::MCInstPrinter::formatImm(), llvm::MCRegisterInfo::getMatchingSuperReg(), llvm::MCRegisterInfo::getRegClass(), getRegisterName(), MI, llvm::MCInstPrinter::MRI, llvm::MCInstPrinter::printAnnotation(), and printOperand().
Referenced by printInst().
|
overridevirtual |
Print the assembler register name.
Reimplemented from llvm::MCInstPrinter.
Definition at line 62 of file AArch64InstPrinter.cpp.
References getRegisterName(), llvm::MCInstPrinter::markup(), OS, and llvm::MCInstPrinter::Register.
Referenced by printAMIndexedWB(), printAMNoIndex(), printExtendedRegister(), printGPR64as32(), printGPR64x8(), printGPRSeqPairsClassOperand(), printInst(), llvm::AArch64AppleInstPrinter::printInst(), printMatrix(), printMatrixTile(), printMatrixTileList(), printOperand(), printPostIncOperand(), printShiftedRegister(), printSVERegOp(), printSysAlias(), printVectorList(), printVRegOperand(), and printZPRasFPR().
void AArch64InstPrinter::printRegName | ( | raw_ostream & | OS, |
MCRegister | Reg, | ||
unsigned | AltIdx | ||
) | const |
Definition at line 66 of file AArch64InstPrinter.cpp.
References getRegisterName(), llvm::MCInstPrinter::markup(), OS, and llvm::MCInstPrinter::Register.
|
protected |
Definition at line 1328 of file AArch64InstPrinter.cpp.
References assert(), MI, printMemExtendImpl(), and printOperand().
|
protected |
Definition at line 1441 of file AArch64InstPrinter.cpp.
References llvm::MCInstPrinter::formatImm(), and MI.
|
protected |
Definition at line 1258 of file AArch64InstPrinter.cpp.
References MI, printRegName(), and printShifter().
|
protected |
Definition at line 1245 of file AArch64InstPrinter.cpp.
References llvm::AArch64_AM::getShiftExtendName(), llvm::AArch64_AM::getShiftType(), llvm::AArch64_AM::getShiftValue(), llvm::MCInstPrinter::Immediate, llvm::AArch64_AM::LSL, llvm::MCInstPrinter::markup(), and MI.
Referenced by printAddSubImm(), printImm8OptLsl(), and printShiftedRegister().
|
protected |
Definition at line 1955 of file AArch64InstPrinter.cpp.
References llvm::AArch64_AM::decodeAdvSIMDModImmType10(), llvm::format(), llvm::MCInstPrinter::Immediate, llvm::MCInstPrinter::markup(), and MI.
|
protected |
Definition at line 1171 of file AArch64InstPrinter.cpp.
References llvm::MCInstPrinter::formatImm(), llvm::MCInstPrinter::Immediate, llvm::MCInstPrinter::markup(), MI, and Size.
|
protected |
Definition at line 1130 of file AArch64InstPrinter.cpp.
References assert(), llvm::MCOperand::getImm(), llvm::MCOperand::isImm(), and MI.
|
protected |
Definition at line 2061 of file AArch64InstPrinter.cpp.
References llvm::AArch64_AM::decodeLogicalImmediate(), llvm::MCInstPrinter::formatHex(), llvm::MCInstPrinter::Immediate, llvm::MCInstPrinter::markup(), MI, and printImmSVE().
|
protected |
Definition at line 1971 of file AArch64InstPrinter.cpp.
References llvm::MCInstPrinter::formatImm(), llvm::MCInstPrinter::Immediate, llvm::MCInstPrinter::markup(), and MI.
|
protected |
Definition at line 1997 of file AArch64InstPrinter.cpp.
References llvm_unreachable, MI, and printRegName().
|
protected |
Definition at line 1981 of file AArch64InstPrinter.cpp.
References llvm_unreachable, and MI.
|
protected |
Definition at line 897 of file AArch64InstPrinter.cpp.
References assert(), llvm::MCSubtargetInfo::getFeatureBits(), llvm::MCOperand::getImm(), llvm::MCSubtargetInfo::hasFeature(), llvm::SysAlias::haveFeatures(), MI, Name, llvm::SysAlias::Name, llvm::SysAliasReg::NeedsReg, and printRegName().
Referenced by printInst().
|
protected |
Definition at line 1205 of file AArch64InstPrinter.cpp.
|
protected |
Definition at line 1017 of file AArch64InstPrinter.cpp.
References assert(), llvm::MCSubtargetInfo::getFeatureBits(), llvm::MCOperand::getImm(), llvm::MCSubtargetInfo::hasFeature(), llvm::SysAlias::haveFeatures(), MI, Name, llvm::SysAlias::Name, and printSyspXzrPair().
Referenced by printInst().
|
protected |
Definition at line 2122 of file AArch64InstPrinter.cpp.
References assert(), getRegisterName(), and MI.
Referenced by printSyspAlias().
|
protected |
Definition at line 1940 of file AArch64InstPrinter.cpp.
References llvm::MCInstPrinter::formatImm(), llvm::MCSubtargetInfo::getFeatureBits(), and MI.
|
protected |
Definition at line 1740 of file AArch64InstPrinter.cpp.
References MI, and printVectorList().
|
inlineprotected |
Definition at line 118 of file AArch64InstPrinter.h.
References MI, and printUImm12Offset().
|
protected |
Definition at line 1414 of file AArch64InstPrinter.cpp.
References assert(), llvm::MCInstPrinter::formatImm(), llvm::MCOperand::getExpr(), llvm::MCOperand::getImm(), llvm::MCInstPrinter::Immediate, llvm::MCOperand::isExpr(), llvm::MCOperand::isImm(), llvm::MCInstPrinter::MAI, llvm::MCInstPrinter::markup(), MI, and llvm::MCExpr::print().
Referenced by printUImm12Offset().
|
protected |
Definition at line 1757 of file AArch64InstPrinter.cpp.
References MI.
|
protected |
Definition at line 1648 of file AArch64InstPrinter.cpp.
References llvm::MCRegisterClass::contains(), llvm::MCRegisterInfo::getMatchingSuperReg(), getNextVectorRegister(), llvm::MCRegisterInfo::getRegClass(), llvm::MCRegisterInfo::getSubReg(), MI, llvm::MCInstPrinter::MRI, and printRegName().
Referenced by printImplicitlyTypedVectorList(), llvm::AArch64AppleInstPrinter::printInst(), and printTypedVectorList().
|
protected |
Definition at line 1196 of file AArch64InstPrinter.cpp.
References assert(), MI, and printRegName().
|
protected |
Definition at line 2080 of file AArch64InstPrinter.cpp.
References llvm::sampleprof::Base, llvm_unreachable, MI, and printRegName().