26 #define DEBUG_TYPE "asm-printer" 29 #define PRINT_ALIAS_INSTR 30 #include "LanaiGenAsmWriter.inc" 39 OS <<
"\t" << Alias <<
" ";
69 bool LanaiInstPrinter::printMemoryLoadIncrement(
const MCInst *MI,
80 OS <<
"\t" << Opcode <<
"\t[%" 88 bool LanaiInstPrinter::printMemoryStoreIncrement(
const MCInst *MI,
114 return printMemoryLoadIncrement(MI, OS,
"ld", 4);
116 return printMemoryLoadIncrement(MI, OS,
"ld.h", 2);
118 return printMemoryLoadIncrement(MI, OS,
"uld.h", 2);
120 return printMemoryLoadIncrement(MI, OS,
"ld.b", 1);
122 return printMemoryLoadIncrement(MI, OS,
"uld.b", 1);
128 return printMemoryStoreIncrement(MI, OS,
"st", 4);
130 return printMemoryStoreIncrement(MI, OS,
"st.h", 2);
132 return printMemoryStoreIncrement(MI, OS,
"st.b", 1);
148 assert((Modifier == 0 || Modifier[0] == 0) &&
"No modifiers supported");
212 assert(RegOp.
isReg() &&
"Register operand expected");
222 template <
unsigned SizeInBits>
227 if (OffsetOp.
isImm()) {
228 assert(isInt<SizeInBits>(OffsetOp.
getImm()) &&
"Constant value truncated");
243 printMemoryImmediateOffset<16>(
MAI, OffsetOp, OS);
279 printMemoryImmediateOffset<10>(
MAI, OffsetOp, OS);
void printMemSplsOperand(const MCInst *MI, int OpNo, raw_ostream &O, const char *Modifier=nullptr)
void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O, const char *Modifier=nullptr)
static void printMemoryImmediateOffset(const MCAsmInfo &MAI, const MCOperand &OffsetOp, raw_ostream &OS)
This class represents lattice values for constants.
static StringRef lanaiCondCodeToString(LPCC::CondCode CC)
static StringRef decIncOperator(const MCInst *MI)
static const char * lanaiAluCodeToString(unsigned AluOp)
void printCCOperand(const MCInst *MI, int OpNo, raw_ostream &O)
void printLo16AndImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
unsigned getReg() const
Returns the register number.
static bool usesGivenOffset(const MCInst *MI, int AddOffset)
const MCExpr * getExpr() const
Instances of this class represent a single low-level machine instruction.
void printHi16ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
This class is intended to be used as a base class for asm properties and features specific to the tar...
static bool isPreOp(unsigned AluOp)
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot, const MCSubtargetInfo &STI) override
Print the specified MCInst to the specified raw_ostream.
void printMemRiOperand(const MCInst *MI, int OpNo, raw_ostream &O, const char *Modifier=nullptr)
void printMemRrOperand(const MCInst *MI, int OpNo, raw_ostream &O, const char *Modifier=nullptr)
void printMemImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
static void printMemoryBaseRegister(raw_ostream &OS, const unsigned AluCode, const MCOperand &RegOp)
static const char * getRegisterName(unsigned RegNo)
const MCOperand & getOperand(unsigned i) const
static bool isPreIncrementForm(const MCInst *MI, int AddOffset)
static bool isPostOp(unsigned AluOp)
void printInstruction(const MCInst *MI, raw_ostream &O)
void printPredicateOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O)
format_object< int64_t > formatHex(int64_t Value) const
Generic base class for all target subtargets.
static unsigned encodeLanaiAluCode(unsigned AluOp)
LLVM_NODISCARD std::string lower() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void printAnnotation(raw_ostream &OS, StringRef Annot)
Utility function for printing annotations.
static bool isPostIncrementForm(const MCInst *MI, int AddOffset)
bool printAliasInstr(const MCInst *MI, raw_ostream &OS)
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.
unsigned getOpcode() const
Instances of this class represent operands of the MCInst class.
void printRegName(raw_ostream &OS, unsigned RegNo) const override
Print the assembler register name.
void printHi16AndImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)