Go to the documentation of this file.
32 #define DEBUG_TYPE "csky-asm-printer"
35 #define PRINT_ALIAS_INSTR
36 #include "CSKYGenAsmWriter.inc"
40 cl::desc(
"Disable the emission of assembler pseudo instructions"),
45 cl::desc(
"Print architectural register names rather than the "
46 "ABI names (such as r14 instead of sp)"),
55 if (Opt ==
"no-aliases") {
59 if (Opt ==
"numeric") {
67 if (Opt ==
"abi-names") {
88 : CSKY::NoRegAltName);
102 const char *Modifier) {
103 assert((Modifier == 0 || Modifier[0] == 0) &&
"No modifiers supported");
108 bool useABIName =
false;
110 useABIName = ABIRegNames;
117 if (
Reg == CSKY::R23)
118 O << (useABIName ?
"fp" :
"r23");
119 else if (
Reg == CSKY::R24)
120 O << (useABIName ?
"top" :
"r24");
121 else if (
Reg == CSKY::R25)
122 O << (useABIName ?
"bsp" :
"r25");
142 assert(MO.
isExpr() &&
"Unknown operand kind in printOperand");
175 assert(MO.
isExpr() &&
"Unknown operand kind in printConstpool");
202 auto V =
MI->getOperand(OpNo).getImm();
227 auto V =
MI->getOperand(OpNum).getImm();
233 auto Offset = (V & 0xf) - 1;
240 if ((V >> 4) & 0x1) {
245 if ((V >> 5) & 0x7) {
249 auto Offset = ((V >> 5) & 0x7) - 1;
257 if ((V >> 8) & 0x1) {
265 : CSKY::ABIRegAltName);
This is an optimization pass for GlobalISel generic memory operations.
void printRegisterList(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
Target - Wrapper for Target specific information.
void printFPRRegName(raw_ostream &O, unsigned RegNo) const
Reg
All possible values of the reg field in the ModR/M byte.
void printInstruction(const MCInst *MI, uint64_t Address, const MCSubtargetInfo &STI, raw_ostream &O)
Instances of this class represent a single low-level machine instruction.
bool PrintBranchImmAsAddress
If true, a branch immediate (e.g.
bool printAliasInstr(const MCInst *MI, uint64_t Address, const MCSubtargetInfo &STI, raw_ostream &O)
(vector float) vec_cmpeq(*A, *B) C
static cl::opt< bool > ArchRegNames("csky-arch-reg-names", cl::desc("Print architectural register names rather than the " "ABI names (such as r14 instead of sp)"), cl::init(false), cl::Hidden)
const FeatureBitset & getFeatureBits() const
This class implements an extremely fast bulk output stream that can only output to a stream.
void printCSKYSymbolOperand(const MCInst *MI, uint64_t Address, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
void printAnnotation(raw_ostream &OS, StringRef Annot)
Utility function for printing annotations.
bool applyTargetSpecificCLOption(StringRef Opt) override
Customize the printer according to a command line option.
void printRegName(raw_ostream &O, MCRegister Reg) const override
Print the assembler register name.
initializer< Ty > init(const Ty &Val)
format_object< int64_t > formatHex(int64_t Value) const
void printRegisterSeq(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void printConstpool(const MCInst *MI, uint64_t Address, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
StringRef - Represent a constant reference to a string, i.e.
static const char * getRegisterName(MCRegister Reg)
void printOperand(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O, const char *Modifier=nullptr)
const MCExpr * getExpr() const
void printFPR(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
bool DebugFlag
This boolean is set to true if the '-debug' command line option is specified.
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
void printDataSymbol(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
static cl::opt< bool > NoAliases("csky-no-aliases", cl::desc("Disable the emission of assembler pseudo instructions"), cl::init(false), cl::Hidden)
Instances of this class represent operands of the MCInst class.
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode.
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.
Generic base class for all target subtargets.
Wrapper class representing physical registers. Should be passed by value.
unsigned getReg() const
Returns the register number.
void printPSRFlag(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)