LLVM 20.0.0git
|
#include "Target/RISCV/MCTargetDesc/RISCVInstPrinter.h"
Static Public Member Functions | |
static const char * | getRegisterName (MCRegister Reg) |
static const char * | getRegisterName (MCRegister Reg, unsigned AltIdx) |
Additional Inherited Members | |
Public Types inherited from llvm::MCInstPrinter | |
enum class | Markup { Immediate , Register , Target , Memory } |
Protected Member Functions inherited from llvm::MCInstPrinter | |
void | printAnnotation (raw_ostream &OS, StringRef Annot) |
Utility function for printing annotations. | |
const char * | matchAliasPatterns (const MCInst *MI, const MCSubtargetInfo *STI, const AliasMatchingData &M) |
Helper for matching MCInsts to alias patterns when printing instructions. | |
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. | |
SmallVector< raw_ostream::Colors, 4 > | ColorStack {raw_ostream::Colors::RESET} |
Definition at line 21 of file RISCVInstPrinter.h.
|
inline |
Definition at line 23 of file RISCVInstPrinter.h.
Customize the printer according to a command line option.
Reimplemented from llvm::MCInstPrinter.
Definition at line 48 of file RISCVInstPrinter.cpp.
References ArchRegNames, and 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.
|
static |
Definition at line 308 of file RISCVInstPrinter.cpp.
References ArchRegNames, and getRegisterName().
Referenced by getRegisterName(), and printRegName().
|
static |
bool llvm::RISCVInstPrinter::printAliasInstr | ( | const MCInst * | MI, |
uint64_t | Address, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Referenced by printInst().
void RISCVInstPrinter::printBranchOperand | ( | const MCInst * | MI, |
uint64_t | Address, | ||
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 100 of file RISCVInstPrinter.cpp.
References llvm::Address, llvm::MCInstPrinter::formatHex(), llvm::MCInstPrinter::formatImm(), llvm::MCOperand::getImm(), llvm::MCSubtargetInfo::hasFeature(), llvm::MCOperand::isImm(), llvm::MCInstPrinter::markup(), MI, llvm::MCInstPrinter::PrintBranchImmAsAddress, printOperand(), and llvm::MCInstPrinter::Target.
void RISCVInstPrinter::printCSRSystemRegister | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 118 of file RISCVInstPrinter.cpp.
References llvm::MCInstPrinter::formatImm(), llvm::MCSubtargetInfo::getFeatureBits(), llvm::MCInstPrinter::markup(), MI, Range, and llvm::MCInstPrinter::Register.
void llvm::RISCVInstPrinter::printCustomAliasOperand | ( | const MCInst * | MI, |
uint64_t | Address, | ||
unsigned | OpIdx, | ||
unsigned | PrintMethodIdx, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
void RISCVInstPrinter::printFenceArg | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 132 of file RISCVInstPrinter.cpp.
References assert(), llvm::RISCVFenceField::I, MI, llvm::RISCVFenceField::O, llvm::RISCVFenceField::R, and llvm::RISCVFenceField::W.
void RISCVInstPrinter::printFPImmOperand | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 172 of file RISCVInstPrinter.cpp.
References llvm::format(), llvm::RISCVLoadFPImm::getFPImm(), llvm::MCInstPrinter::Immediate, llvm::MCInstPrinter::markup(), and MI.
void RISCVInstPrinter::printFRMArg | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 150 of file RISCVInstPrinter.cpp.
References llvm::RISCVFPRndMode::DYN, MI, NoAliases, llvm::MCInstPrinter::PrintAliases, and llvm::RISCVFPRndMode::roundingModeToString().
void RISCVInstPrinter::printFRMArgLegacy | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 159 of file RISCVInstPrinter.cpp.
References MI, llvm::RISCVFPRndMode::RNE, and llvm::RISCVFPRndMode::roundingModeToString().
|
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.
Definition at line 61 of file RISCVInstPrinter.cpp.
References llvm::Address, MI, NoAliases, llvm::MCInstPrinter::PrintAliases, printAliasInstr(), llvm::MCInstPrinter::printAnnotation(), printInstruction(), and llvm::RISCVRVC::uncompress().
void llvm::RISCVInstPrinter::printInstruction | ( | const MCInst * | MI, |
uint64_t | Address, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Referenced by printInst().
|
inline |
Definition at line 58 of file RISCVInstPrinter.h.
References MI, and printStackAdj().
void RISCVInstPrinter::printOperand | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O, | ||
const char * | Modifier = nullptr |
||
) |
Definition at line 80 of file RISCVInstPrinter.cpp.
References assert(), llvm::MCInstPrinter::formatImm(), llvm::MCOperand::getExpr(), llvm::MCOperand::getImm(), llvm::MCOperand::getReg(), llvm::MCInstPrinter::Immediate, llvm::MCOperand::isExpr(), llvm::MCOperand::isImm(), llvm::MCOperand::isReg(), llvm::MCInstPrinter::MAI, llvm::MCInstPrinter::markup(), MI, llvm::MCExpr::print(), and printRegName().
Referenced by printBranchOperand().
|
overridevirtual |
Print the assembler register name.
Reimplemented from llvm::MCInstPrinter.
Definition at line 76 of file RISCVInstPrinter.cpp.
References getRegisterName(), llvm::MCInstPrinter::markup(), and llvm::MCInstPrinter::Register.
Referenced by printOperand(), printRegReg(), printRlist(), printVMaskReg(), and printZeroOffsetMemOp().
void RISCVInstPrinter::printRegReg | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 261 of file RISCVInstPrinter.cpp.
References assert(), llvm::MCOperand::getReg(), llvm::MCOperand::isReg(), MI, and printRegName().
void RISCVInstPrinter::printRlist | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 223 of file RISCVInstPrinter.cpp.
References ArchRegNames, MI, llvm::Offset, printRegName(), llvm::RISCVZC::RA_S0, llvm::RISCVZC::RA_S0_S1, llvm::RISCVZC::RA_S0_S11, llvm::RISCVZC::RA_S0_S2, and llvm::RISCVZC::RA_S0_S3.
void RISCVInstPrinter::printStackAdj | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O, | ||
bool | Negate = false |
||
) |
Definition at line 275 of file RISCVInstPrinter.cpp.
References assert(), llvm::sampleprof::Base, llvm::RISCVZC::getStackAdjBase(), llvm::MCSubtargetInfo::hasFeature(), llvm::MCInstPrinter::Immediate, llvm::MCInstPrinter::markup(), and MI.
Referenced by printNegStackAdj().
void RISCVInstPrinter::printVMaskReg | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 295 of file RISCVInstPrinter.cpp.
References assert(), llvm::MCOperand::getReg(), llvm::MCOperand::isReg(), MI, and printRegName().
void RISCVInstPrinter::printVTypeI | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 206 of file RISCVInstPrinter.cpp.
References llvm::MCInstPrinter::formatImm(), llvm::RISCVVType::getSEW(), llvm::RISCVVType::getVLMUL(), llvm::RISCVII::LMUL_RESERVED, MI, and llvm::RISCVVType::printVType().
void RISCVInstPrinter::printZeroOffsetMemOp | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 195 of file RISCVInstPrinter.cpp.
References assert(), llvm::MCOperand::getReg(), llvm::MCOperand::isReg(), MI, and printRegName().