LLVM 20.0.0git
|
#include "Target/PowerPC/MCTargetDesc/PPCInstPrinter.h"
Static Public Member Functions | |
static const char * | getRegisterName (MCRegister Reg) |
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 PPCInstPrinter.h.
|
inline |
Definition at line 30 of file PPCInstPrinter.h.
|
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 |
Referenced by printOperand(), and printRegName().
void PPCInstPrinter::printAbsBranchOperand | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 481 of file PPCInstPrinter.cpp.
References llvm::MCInstPrinter::formatHex(), llvm::Triple::isPPC64(), MI, and printOperand().
bool llvm::PPCInstPrinter::printAliasInstr | ( | const MCInst * | MI, |
uint64_t | Address, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | OS | ||
) |
Referenced by printInst().
void PPCInstPrinter::printATBitsAsHint | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 316 of file PPCInstPrinter.cpp.
References MI.
void PPCInstPrinter::printBranchOperand | ( | const MCInst * | MI, |
uint64_t | Address, | ||
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 454 of file PPCInstPrinter.cpp.
References llvm::Address, llvm::MCInstPrinter::formatHex(), llvm::Triple::isOSAIX(), llvm::Triple::isPPC64(), MI, llvm::MCInstPrinter::PrintBranchImmAsAddress, and printOperand().
void PPCInstPrinter::printcrbitm | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 493 of file PPCInstPrinter.cpp.
References llvm_unreachable, and MI.
void llvm::PPCInstPrinter::printCustomAliasOperand | ( | const MCInst * | MI, |
uint64_t | Address, | ||
unsigned | OpIdx, | ||
unsigned | PrintMethodIdx, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | OS | ||
) |
void PPCInstPrinter::printImmZeroOperand | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 366 of file PPCInstPrinter.cpp.
Referenced by printMemRegImm34PCRel().
|
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 55 of file PPCInstPrinter.cpp.
References llvm::Address, assert(), llvm::MCOperand::getExpr(), llvm::MCSymbolRefExpr::getKind(), llvm::MCSymbolRefExpr::getSymbol(), llvm::MCSubtargetInfo::hasFeature(), llvm::MCOperand::isExpr(), llvm::Triple::isOSAIX(), llvm::MCInstPrinter::MAI, MI, printAliasInstr(), llvm::MCInstPrinter::printAnnotation(), printInstruction(), printOperand(), and llvm::MCSymbolRefExpr::VK_PPC_PCREL_OPT.
void llvm::PPCInstPrinter::printInstruction | ( | const MCInst * | MI, |
uint64_t | Address, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Referenced by printInst().
void PPCInstPrinter::printMemRegImm | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 511 of file PPCInstPrinter.cpp.
References MI, printOperand(), and printS16ImmOperand().
void PPCInstPrinter::printMemRegImm34 | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 541 of file PPCInstPrinter.cpp.
References MI, printOperand(), and printS34ImmOperand().
void PPCInstPrinter::printMemRegImm34PCRel | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 532 of file PPCInstPrinter.cpp.
References MI, printImmZeroOperand(), and printS34ImmOperand().
void PPCInstPrinter::printMemRegImmHash | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 523 of file PPCInstPrinter.cpp.
References MI, and printOperand().
void PPCInstPrinter::printMemRegReg | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 550 of file PPCInstPrinter.cpp.
References MI, and printOperand().
void PPCInstPrinter::printOperand | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 647 of file PPCInstPrinter.cpp.
References assert(), llvm::MCInstrInfo::get(), llvm::MCRegisterInfo::getEncodingValue(), getRegisterName(), llvm::PPC::getRegNumForOperand(), llvm::MCInstPrinter::MAI, MI, llvm::MCInstPrinter::MII, llvm::MCInstPrinter::MRI, llvm::DWARFExpression::Operation::print(), RegName, ShowVSRNumsAsVR, and llvm::PPC::stripRegisterPrefix().
Referenced by printAbsBranchOperand(), printBranchOperand(), printInst(), printMemRegImm(), printMemRegImm34(), printMemRegImmHash(), printMemRegReg(), printPredicateOperand(), printS16ImmOperand(), printS34ImmOperand(), printTLSCall(), and printU16ImmOperand().
void PPCInstPrinter::printPredicateOperand | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O, | ||
const char * | Modifier = nullptr |
||
) |
Definition at line 218 of file PPCInstPrinter.cpp.
References assert(), llvm_unreachable, MI, llvm::PPC::PRED_BIT_SET, llvm::PPC::PRED_BIT_UNSET, llvm::PPC::PRED_EQ, llvm::PPC::PRED_EQ_MINUS, llvm::PPC::PRED_EQ_PLUS, llvm::PPC::PRED_GE, llvm::PPC::PRED_GE_MINUS, llvm::PPC::PRED_GE_PLUS, llvm::PPC::PRED_GT, llvm::PPC::PRED_GT_MINUS, llvm::PPC::PRED_GT_PLUS, llvm::PPC::PRED_LE, llvm::PPC::PRED_LE_MINUS, llvm::PPC::PRED_LE_PLUS, llvm::PPC::PRED_LT, llvm::PPC::PRED_LT_MINUS, llvm::PPC::PRED_LT_PLUS, llvm::PPC::PRED_NE, llvm::PPC::PRED_NE_MINUS, llvm::PPC::PRED_NE_PLUS, llvm::PPC::PRED_NU, llvm::PPC::PRED_NU_MINUS, llvm::PPC::PRED_NU_PLUS, llvm::PPC::PRED_UN, llvm::PPC::PRED_UN_MINUS, llvm::PPC::PRED_UN_PLUS, and printOperand().
|
overridevirtual |
Print the assembler register name.
Reimplemented from llvm::MCInstPrinter.
Definition at line 50 of file PPCInstPrinter.cpp.
References getRegisterName(), OS, and RegName.
void PPCInstPrinter::printS16ImmOperand | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 424 of file PPCInstPrinter.cpp.
References MI, and printOperand().
Referenced by printMemRegImm().
void PPCInstPrinter::printS34ImmOperand | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 433 of file PPCInstPrinter.cpp.
References assert(), MI, and printOperand().
Referenced by printMemRegImm34(), and printMemRegImm34PCRel().
void PPCInstPrinter::printS5ImmOperand | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 358 of file PPCInstPrinter.cpp.
References MI.
void PPCInstPrinter::printTLSCall | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 564 of file PPCInstPrinter.cpp.
References llvm::MCSymbolRefExpr::getKind(), llvm::MCSymbol::getName(), llvm::MCSymbolRefExpr::getSymbol(), llvm::MCSymbolRefExpr::getVariantKindName(), llvm::MCInstPrinter::MAI, MI, llvm::MCExpr::print(), printOperand(), llvm::MCSymbolRefExpr::VK_None, and llvm::MCSymbolRefExpr::VK_PPC_NOTOC.
void PPCInstPrinter::printU10ImmOperand | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 408 of file PPCInstPrinter.cpp.
void PPCInstPrinter::printU12ImmOperand | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 416 of file PPCInstPrinter.cpp.
void PPCInstPrinter::printU16ImmOperand | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 445 of file PPCInstPrinter.cpp.
References MI, and printOperand().
void PPCInstPrinter::printU1ImmOperand | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 326 of file PPCInstPrinter.cpp.
void PPCInstPrinter::printU2ImmOperand | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 334 of file PPCInstPrinter.cpp.
void PPCInstPrinter::printU3ImmOperand | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 342 of file PPCInstPrinter.cpp.
void PPCInstPrinter::printU4ImmOperand | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 350 of file PPCInstPrinter.cpp.
void PPCInstPrinter::printU5ImmOperand | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 374 of file PPCInstPrinter.cpp.
void PPCInstPrinter::printU6ImmOperand | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 382 of file PPCInstPrinter.cpp.
void PPCInstPrinter::printU7ImmOperand | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 390 of file PPCInstPrinter.cpp.
void PPCInstPrinter::printU8ImmOperand | ( | const MCInst * | MI, |
unsigned | OpNo, | ||
const MCSubtargetInfo & | STI, | ||
raw_ostream & | O | ||
) |
Definition at line 401 of file PPCInstPrinter.cpp.
References MI.