LLVM
12.0.0git
|
#include "Target/RISCV/MCTargetDesc/RISCVInstPrinter.h"
Static Public Member Functions | |
static const char * | getRegisterName (unsigned RegNo) |
static const char * | getRegisterName (unsigned RegNo, unsigned AltIdx) |
Additional Inherited Members | |
![]() | |
void | printAnnotation (raw_ostream &OS, StringRef Annot) |
Utility function for printing annotations. More... | |
const char * | matchAliasPatterns (const MCInst *MI, const MCSubtargetInfo *STI, const AliasMatchingData &M) |
Helper for matching MCInsts to alias patterns when printing instructions. More... | |
![]() | |
raw_ostream * | CommentStream = nullptr |
A stream that comments can be emitted to if desired. More... | |
const MCAsmInfo & | MAI |
const MCInstrInfo & | MII |
const MCRegisterInfo & | MRI |
const MCInstrAnalysis * | MIA = nullptr |
bool | UseMarkup = false |
True if we are printing marked up assembly. More... | |
bool | PrintImmHex = false |
True if we are printing immediates as hex. More... | |
HexStyle::Style | PrintHexStyle = HexStyle::C |
Which style to use for printing hexadecimal values. More... | |
bool | PrintBranchImmAsAddress = false |
If true, a branch immediate (e.g. More... | |
bool | SymbolizeOperands = false |
If true, symbolize branch target and memory reference operands. More... | |
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 53 of file RISCVInstPrinter.cpp.
References ArchRegNames, and NoAliases.
|
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.
Definition at line 189 of file RISCVInstPrinter.cpp.
References ArchRegNames.
Referenced by printRegName().
|
static |
bool llvm::RISCVInstPrinter::printAliasInstr | ( | const MCInst * | MI, |
uint64_t | Address, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Referenced by printInst().
void RISCVInstPrinter::printAtomicMemOp | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 159 of file RISCVInstPrinter.cpp.
References assert(), llvm::MCOperand::getReg(), llvm::MCOperand::isReg(), MI, llvm::RISCVFenceField::O, and printRegName().
void RISCVInstPrinter::printBranchOperand | ( | const MCInst * | MI, |
uint64_t | Address, | ||
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 105 of file RISCVInstPrinter.cpp.
References llvm::Address, llvm::MCInstPrinter::formatHex(), llvm::MCOperand::getImm(), llvm::MCSubtargetInfo::hasFeature(), llvm::MCOperand::isImm(), MI, llvm::RISCVFenceField::O, llvm::MCInstPrinter::PrintBranchImmAsAddress, and printOperand().
void RISCVInstPrinter::printCSRSystemRegister | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 123 of file RISCVInstPrinter.cpp.
References llvm::MCSubtargetInfo::getFeatureBits(), llvm::AArch64SysReg::lookupSysRegByEncoding(), MI, and llvm::RISCVFenceField::O.
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 134 of file RISCVInstPrinter.cpp.
References assert(), llvm::RISCVFenceField::I, MI, llvm::RISCVFenceField::O, llvm::RISCVFenceField::R, and llvm::RISCVFenceField::W.
void RISCVInstPrinter::printFRMArg | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 152 of file RISCVInstPrinter.cpp.
References MI, llvm::RISCVFenceField::O, 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 66 of file RISCVInstPrinter.cpp.
References llvm::Address, MI, llvm::MCInstPrinter::MRI, NoAliases, llvm::RISCVFenceField::O, printAliasInstr(), llvm::MCInstPrinter::printAnnotation(), and printInstruction().
void llvm::RISCVInstPrinter::printInstruction | ( | const MCInst * | MI, |
uint64_t | Address, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Referenced by printInst().
void RISCVInstPrinter::printOperand | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O, | ||
const char * | Modifier = nullptr |
||
) |
Definition at line 85 of file RISCVInstPrinter.cpp.
References assert(), llvm::MCOperand::getExpr(), llvm::MCOperand::getImm(), llvm::MCOperand::getReg(), llvm::MCOperand::isExpr(), llvm::MCOperand::isImm(), llvm::MCOperand::isReg(), llvm::MCInstPrinter::MAI, MI, llvm::RISCVFenceField::O, llvm::MCExpr::print(), and printRegName().
Referenced by printBranchOperand().
|
overridevirtual |
Print the assembler register name.
Reimplemented from llvm::MCInstPrinter.
Definition at line 81 of file RISCVInstPrinter.cpp.
References getRegisterName(), and llvm::RISCVFenceField::O.
Referenced by printAtomicMemOp(), printOperand(), and printVMaskReg().
void RISCVInstPrinter::printVMaskReg | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 176 of file RISCVInstPrinter.cpp.
References assert(), llvm::MCOperand::getReg(), llvm::MCOperand::isReg(), MI, llvm::RISCVFenceField::O, and printRegName().
void RISCVInstPrinter::printVTypeI | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 170 of file RISCVInstPrinter.cpp.
References MI, llvm::RISCVFenceField::O, and llvm::RISCVVType::printVType().