27 #define DEBUG_TYPE "asm-printer" 30 #define PRINT_ALIAS_INSTR 31 #include "RISCVGenAsmWriter.inc" 34 #define GEN_UNCOMPRESS_INSTR 35 #include "RISCVGenCompressInstEmitter.inc" 39 cl::desc(
"Disable the emission of assembler pseudo instructions"),
44 cl::desc(
"Print architectural register names rather than the " 45 "ABI names (such as x2 instead of sp)"),
54 if (Opt ==
"no-aliases") {
58 if (Opt ==
"numeric") {
73 Res = uncompressInst(UncompressedMI, *MI,
MRI, STI);
75 NewMI =
const_cast<MCInst *
>(&UncompressedMI);
87 const char *Modifier) {
88 assert((Modifier == 0 || Modifier[0] == 0) &&
"No modifiers supported");
101 assert(MO.
isExpr() &&
"Unknown operand kind in printOperand");
120 assert (((FenceArg >> 4) == 0) &&
"Invalid immediate in printFenceArg");
146 assert(MO.
isReg() &&
"printAtomicMemOp can only print register operands");
155 : RISCV::ABIRegAltName);
This class represents lattice values for constants.
static const char * getRegisterName(unsigned RegNo)
const FeatureBitset & getFeatureBits() const
void printCSRSystemRegister(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
unsigned getReg() const
Returns the register number.
const MCExpr * getExpr() const
void printFRMArg(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
Instances of this class represent a single low-level machine instruction.
initializer< Ty > init(const Ty &Val)
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
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.
bool applyTargetSpecificCLOption(StringRef Opt) override
Customize the printer according to a command line option.
void printFenceArg(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
const MCOperand & getOperand(unsigned i) const
static cl::opt< bool > NoAliases("riscv-no-aliases", cl::desc("Disable the emission of assembler pseudo instructions"), cl::init(false), cl::Hidden)
bool printAliasInstr(const MCInst *MI, const MCSubtargetInfo &STI, raw_ostream &O)
void printInstruction(const MCInst *MI, uint64_t Address, const MCSubtargetInfo &STI, raw_ostream &O)
void printAtomicMemOp(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
void printOperand(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O, const char *Modifier=nullptr)
Generic base class for all target subtargets.
static cl::opt< bool > ArchRegNames("riscv-arch-reg-names", cl::desc("Print architectural register names rather than the " "ABI names (such as x2 instead of sp)"), cl::init(false), cl::Hidden)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static StringRef roundingModeToString(RoundingMode RndMode)
void printAnnotation(raw_ostream &OS, StringRef Annot)
Utility function for printing annotations.
const SysReg * lookupSysRegByEncoding(uint16_t)
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.
void printRegName(raw_ostream &O, unsigned RegNo) const override
Print the assembler register name.
Instances of this class represent operands of the MCInst class.
const MCRegisterInfo & MRI