LLVM 24.0.0git
llvm::PISAInstPrinter Class Reference

#include "Target/PISA/MCTargetDesc/PISAInstPrinter.h"

Inheritance diagram for llvm::PISAInstPrinter:
[legend]

Classes

struct  MemSeqOperandPrinter

Public Types

typedef std::function< void(const MCInst *, unsigned, raw_ostream &)> printOpndFn
Public Types inherited from llvm::MCInstPrinter
enum class  Markup { Immediate , Register , Target , Memory }

Public Member Functions

bool printAliasInstr (const MCInst *MI, uint64_t Address, raw_ostream &OS)
void printCustomAliasOperand (const MCInst *MI, uint64_t Address, unsigned OpIdx, unsigned PrintMethodIdx, raw_ostream &OS)
void printInst (const MCInst *MI, uint64_t Address, StringRef Annot, const MCSubtargetInfo &STI, raw_ostream &OS) override
 Print the specified MCInst to the specified raw_ostream.
void printRegName (raw_ostream &OS, MCRegister Reg) override
 Print the assembler register name.
void printOperand (const MCInst *MI, unsigned OpNo, raw_ostream &O, const char *Modifier=nullptr)
printOpndFn printBoolOptionOpnd (PISA::BoolOptionID OptID)
void printEnumOption (PISA::EnumOptionClass OptClass, bool IsMandatoryField, unsigned DefaultVal, const MCInst *MCI, unsigned OpNo, raw_ostream &OS)
printOpndFn printEnumOption (PISA::EnumOptionClass OptClass, bool IsMandatoryField=false, unsigned DefaultVal=0)
void printImm1Opnd (const MCInst *MCI, unsigned OpNo, raw_ostream &OS)
void printImm8Opnd (const MCInst *MCI, unsigned OpNo, raw_ostream &OS)
void printImm16Opnd (const MCInst *MCI, unsigned OpNo, raw_ostream &OS)
void printImm32Opnd (const MCInst *MCI, unsigned OpNo, raw_ostream &OS)
void printImm64Opnd (const MCInst *MCI, unsigned OpNo, raw_ostream &OS)
void printImm128Opnd (const MCInst *MCI, unsigned OpNo, raw_ostream &OS)
void printFpImm16Opnd (const MCInst *MCI, unsigned OpNo, raw_ostream &OS)
void printFpImm32Opnd (const MCInst *MCI, unsigned OpNo, raw_ostream &OS)
void printFpImm64Opnd (const MCInst *MCI, unsigned OpNo, raw_ostream &OS)
void printRegOpnd (unsigned RCID, const MCInst *MCI, unsigned OpNo, raw_ostream &OS)
printOpndFn printRegOpnd (unsigned RCID)
void printBrTargetOpnd (const MCInst *MCI, uint64_t Address, unsigned OpNo, raw_ostream &OS)
void printLocalVariableOpnd (const MCInst *MCI, unsigned OpNo, raw_ostream &OS)
void printGlobalVariableOpnd (const MCInst *MCI, uint64_t Address, unsigned OpNo, raw_ostream &OS)
void printMemScopeOpnd (const MCInst *MCI, unsigned OpNo, raw_ostream &OS)
void negateRepr (const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printStringImm (const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printAddrOffsetImm (const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printBfnOpcode (const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printMemOperand (const MCInst *MI, int OpNo, raw_ostream &O, const char *Modifier=nullptr)
void printMemSeqOperand (StringRef Pattern, const MCInst *MI, int OpNo, raw_ostream &OS, const char *Modifier)
MemSeqOperandPrinter printMemSeqOperand (StringRef Pattern)
void printParamMemOperand (const MCInst *MI, int OpNo, raw_ostream &O)
void printFunctionCallTargetOpnd (const MCInst *MI, unsigned OpNo, raw_ostream &O)
std::pair< const char *, uint64_t > getMnemonic (const MCInst &MI) const override
 Returns a pair containing the mnemonic for MI and the number of bits left for further processing by printInstruction (generated by tablegen).
void printInstruction (const MCInst *MI, uint64_t Address, raw_ostream &O)
 MCInstPrinter (const MCAsmInfo &mai, const MCInstrInfo &mii, const MCRegisterInfo &mri)
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.
StringRef getOpcodeName (unsigned Opcode) const
 Return the name of the specified opcode enum (e.g.
bool getUseMarkup () const
void setUseMarkup (bool Value)
bool getUseColor () const
void setUseColor (bool Value)
WithMarkup markup (raw_ostream &OS, Markup M)
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)
static void printSymbolName (raw_ostream &OS, StringRef Name, const MCAsmInfo *MAI)

Additional Inherited Members

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}

Detailed Description

Definition at line 22 of file PISAInstPrinter.h.

Member Typedef Documentation

◆ printOpndFn

Definition at line 27 of file PISAInstPrinter.h.

Member Function Documentation

◆ getMnemonic()

std::pair< const char *, uint64_t > llvm::PISAInstPrinter::getMnemonic ( const MCInst & MI) const
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.

References MI.

◆ getRegisterName()

const char * llvm::PISAInstPrinter::getRegisterName ( MCRegister Reg)
static

References llvm::MCInstPrinter::MAI, MI, and Reg.

Referenced by printRegName().

◆ MCInstPrinter()

llvm::MCInstPrinter::MCInstPrinter ( const MCAsmInfo & mai,
const MCInstrInfo & mii,
const MCRegisterInfo & mri )
inline

Definition at line 90 of file MCInstPrinter.h.

◆ negateRepr()

void PISAInstPrinter::negateRepr ( const MCInst * MI,
unsigned OpNo,
raw_ostream & O )

Definition at line 193 of file PISAInstPrinter.cpp.

References MI.

◆ printAddrOffsetImm()

void PISAInstPrinter::printAddrOffsetImm ( const MCInst * MI,
unsigned OpNo,
raw_ostream & O )

Definition at line 243 of file PISAInstPrinter.cpp.

References llvm::format(), llvm::MCInstPrinter::formatImm(), and MI.

◆ printAliasInstr()

bool llvm::PISAInstPrinter::printAliasInstr ( const MCInst * MI,
uint64_t Address,
raw_ostream & OS )

References llvm::Address, MI, and uint64_t.

◆ printBfnOpcode()

void PISAInstPrinter::printBfnOpcode ( const MCInst * MI,
unsigned OpNo,
raw_ostream & O )

Definition at line 257 of file PISAInstPrinter.cpp.

References llvm::format_hex(), and MI.

◆ printBoolOptionOpnd()

PISAInstPrinter::printOpndFn PISAInstPrinter::printBoolOptionOpnd ( PISA::BoolOptionID OptID)

Definition at line 413 of file PISAInstPrinter.cpp.

References llvm::MCOperand::getImm(), and llvm::MCInst::getOperand().

◆ printBrTargetOpnd()

void PISAInstPrinter::printBrTargetOpnd ( const MCInst * MCI,
uint64_t Address,
unsigned OpNo,
raw_ostream & OS )

◆ printCustomAliasOperand()

void llvm::PISAInstPrinter::printCustomAliasOperand ( const MCInst * MI,
uint64_t Address,
unsigned OpIdx,
unsigned PrintMethodIdx,
raw_ostream & OS )

References llvm::Address, MI, Reg, and uint64_t.

◆ printEnumOption() [1/2]

void llvm::PISAInstPrinter::printEnumOption ( PISA::EnumOptionClass OptClass,
bool IsMandatoryField,
unsigned DefaultVal,
const MCInst * MCI,
unsigned OpNo,
raw_ostream & OS )

Referenced by printEnumOption().

◆ printEnumOption() [2/2]

printOpndFn llvm::PISAInstPrinter::printEnumOption ( PISA::EnumOptionClass OptClass,
bool IsMandatoryField = false,
unsigned DefaultVal = 0 )
inline

Definition at line 43 of file PISAInstPrinter.h.

References printEnumOption().

◆ printFpImm16Opnd()

void PISAInstPrinter::printFpImm16Opnd ( const MCInst * MCI,
unsigned OpNo,
raw_ostream & OS )

◆ printFpImm32Opnd()

void PISAInstPrinter::printFpImm32Opnd ( const MCInst * MCI,
unsigned OpNo,
raw_ostream & OS )

◆ printFpImm64Opnd()

void PISAInstPrinter::printFpImm64Opnd ( const MCInst * MCI,
unsigned OpNo,
raw_ostream & OS )

◆ printFunctionCallTargetOpnd()

void PISAInstPrinter::printFunctionCallTargetOpnd ( const MCInst * MI,
unsigned OpNo,
raw_ostream & O )

Definition at line 228 of file PISAInstPrinter.cpp.

References MI, and printOperand().

◆ printGlobalVariableOpnd()

void PISAInstPrinter::printGlobalVariableOpnd ( const MCInst * MCI,
uint64_t Address,
unsigned OpNo,
raw_ostream & OS )

◆ printImm128Opnd()

void PISAInstPrinter::printImm128Opnd ( const MCInst * MCI,
unsigned OpNo,
raw_ostream & OS )

◆ printImm16Opnd()

void PISAInstPrinter::printImm16Opnd ( const MCInst * MCI,
unsigned OpNo,
raw_ostream & OS )

◆ printImm1Opnd()

void PISAInstPrinter::printImm1Opnd ( const MCInst * MCI,
unsigned OpNo,
raw_ostream & OS )

◆ printImm32Opnd()

void PISAInstPrinter::printImm32Opnd ( const MCInst * MCI,
unsigned OpNo,
raw_ostream & OS )

◆ printImm64Opnd()

void PISAInstPrinter::printImm64Opnd ( const MCInst * MCI,
unsigned OpNo,
raw_ostream & OS )

◆ printImm8Opnd()

void PISAInstPrinter::printImm8Opnd ( const MCInst * MCI,
unsigned OpNo,
raw_ostream & OS )

◆ printInst()

void PISAInstPrinter::printInst ( const MCInst * MI,
uint64_t Address,
StringRef Annot,
const MCSubtargetInfo & STI,
raw_ostream & OS )
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 48 of file PISAInstPrinter.cpp.

References llvm::Address, MI, llvm::MCInstPrinter::printAnnotation(), and printInstruction().

◆ printInstruction()

void llvm::PISAInstPrinter::printInstruction ( const MCInst * MI,
uint64_t Address,
raw_ostream & O )

References llvm::Address, MI, and uint64_t.

Referenced by printInst().

◆ printLocalVariableOpnd()

void PISAInstPrinter::printLocalVariableOpnd ( const MCInst * MCI,
unsigned OpNo,
raw_ostream & OS )

◆ printMemOperand()

void PISAInstPrinter::printMemOperand ( const MCInst * MI,
int OpNo,
raw_ostream & O,
const char * Modifier = nullptr )

◆ printMemScopeOpnd()

void PISAInstPrinter::printMemScopeOpnd ( const MCInst * MCI,
unsigned OpNo,
raw_ostream & OS )

◆ printMemSeqOperand() [1/2]

MemSeqOperandPrinter llvm::PISAInstPrinter::printMemSeqOperand ( StringRef Pattern)
inline

Definition at line 95 of file PISAInstPrinter.h.

◆ printMemSeqOperand() [2/2]

void PISAInstPrinter::printMemSeqOperand ( StringRef Pattern,
const MCInst * MI,
int OpNo,
raw_ostream & OS,
const char * Modifier )

Definition at line 313 of file PISAInstPrinter.cpp.

References C(), MI, and printOperand().

◆ printOperand()

◆ printParamMemOperand()

◆ printRegName()

void PISAInstPrinter::printRegName ( raw_ostream & OS,
MCRegister Reg )
overridevirtual

Print the assembler register name.

Reimplemented from llvm::MCInstPrinter.

Definition at line 58 of file PISAInstPrinter.cpp.

References llvm::PISA::RegEncoder::decodeVirtualRegister(), and getRegisterName().

Referenced by printMemOperand(), printOperand(), printParamMemOperand(), and printRegOpnd().

◆ printRegOpnd() [1/2]

printOpndFn llvm::PISAInstPrinter::printRegOpnd ( unsigned RCID)
inline

Definition at line 63 of file PISAInstPrinter.h.

References printRegOpnd().

◆ printRegOpnd() [2/2]

void PISAInstPrinter::printRegOpnd ( unsigned RCID,
const MCInst * MCI,
unsigned OpNo,
raw_ostream & OS )

Definition at line 122 of file PISAInstPrinter.cpp.

References llvm::MCInst::getOperand(), llvm::MCOperand::getReg(), and printRegName().

Referenced by printRegOpnd().

◆ printStringImm()

void PISAInstPrinter::printStringImm ( const MCInst * MI,
unsigned OpNo,
raw_ostream & O )

◆ printSymbolName()

void PISAInstPrinter::printSymbolName ( raw_ostream & OS,
StringRef Name,
const MCAsmInfo * MAI )
static

The documentation for this class was generated from the following files: