28#define DEBUG_TYPE "asm-printer"
30#include "NVPTXGenAsmWriter.inc"
39 unsigned RCId = (Reg.id() >> 28);
70 unsigned VReg = Reg.id() & 0x0FFFFFFF;
87 unsigned Reg =
Op.getReg();
89 }
else if (
Op.isImm()) {
92 assert(
Op.isExpr() &&
"Unknown operand kind in printOperand");
100 int64_t Imm = MO.
getImm();
103 if (Modifier ==
"ftz") {
108 }
else if (Modifier ==
"sat") {
113 }
else if (Modifier ==
"relu") {
118 }
else if (Modifier ==
"base") {
160 int64_t Imm = MO.
getImm();
163 if (Modifier ==
"ftz") {
168 }
else if (Modifier ==
"base") {
235 int Imm = (int)MO.
getImm();
236 if (Modifier ==
"sem") {
254 O <<
".mmio.relaxed";
258 "NVPTX LdStCode Printer does not support \"{}\" sem modifier. "
259 "Loads/Stores cannot be AcquireRelease or SequentiallyConsistent.",
260 OrderingToString(Ordering)));
262 }
else if (Modifier ==
"scope") {
281 formatv(
"NVPTX LdStCode Printer does not support \"{}\" sco modifier.",
283 }
else if (Modifier ==
"addsp") {
297 "NVPTX LdStCode Printer does not support \"{}\" addsp modifier.",
298 AddressSpaceToString(
A)));
299 }
else if (Modifier ==
"sign") {
316 }
else if (Modifier ==
"vec") {
334 int Imm = (int)MO.
getImm();
336 if (Modifier.
empty() || Modifier ==
"version") {
339 }
else if (Modifier ==
"aligned") {
353 if (Modifier ==
"add") {
357 if (
MI->getOperand(OpNum + 1).isImm() &&
358 MI->getOperand(OpNum + 1).getImm() == 0)
367 auto &
Op =
MI->getOperand(OpNum);
368 assert(
Op.isImm() &&
"Invalid operand");
369 if (
Op.getImm() != 0) {
377 int64_t Imm =
MI->getOperand(OpNum).getImm();
384 assert(
Op.isExpr() &&
"Call prototype is not an MCExpr?");
386 const MCSymbol &
Sym = cast<MCSymbolRefExpr>(Expr)->getSymbol();
393 int64_t Imm = MO.
getImm();
423 const char *Modifier) {
427 switch (
static_cast<RedTy
>(MO.
getImm())) {
454 "Invalid Reduction Op in printCpAsyncBulkTensorReductionMode");
unsigned const MachineRegisterInfo * MRI
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
This file contains the definitions of the enumerations and flags associated with NVVM Intrinsics.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This class represents an Operation in the Expression.
bool print(raw_ostream &OS, DIDumpOptions DumpOpts, const DWARFExpression *Expr, DWARFUnit *U) const
This class is intended to be used as a base class for asm properties and features specific to the tar...
Base class for the full range of assembler expressions which are needed for parsing.
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
WithMarkup markup(raw_ostream &OS, Markup M)
format_object< int64_t > formatHex(int64_t Value) const
void printAnnotation(raw_ostream &OS, StringRef Annot)
Utility function for printing annotations.
format_object< int64_t > formatImm(int64_t Value) const
Utility function to print immediates in decimal or hex.
Instances of this class represent a single low-level machine instruction.
Interface to description of machine instruction set.
Instances of this class represent operands of the MCInst class.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Wrapper class representing physical registers. Should be passed by value.
Generic base class for all target subtargets.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
void printCmpMode(const MCInst *MI, int OpNum, raw_ostream &O, const char *Modifier=nullptr)
void printHexu32imm(const MCInst *MI, int OpNum, raw_ostream &O, const char *Modifier=nullptr)
void printRegName(raw_ostream &OS, MCRegister Reg) override
Print the assembler register name.
void printMemOperand(const MCInst *MI, int OpNum, raw_ostream &O, const char *Modifier=nullptr)
void printOffseti32imm(const MCInst *MI, int OpNum, raw_ostream &O, const char *Modifier=nullptr)
void printCvtMode(const MCInst *MI, int OpNum, raw_ostream &O, const char *Modifier=nullptr)
void printInstruction(const MCInst *MI, uint64_t Address, raw_ostream &O)
void printLdStCode(const MCInst *MI, int OpNum, raw_ostream &O, const char *Modifier=nullptr)
void printTmaReductionMode(const MCInst *MI, int OpNum, raw_ostream &O, const char *Modifier=nullptr)
void printProtoIdent(const MCInst *MI, int OpNum, raw_ostream &O, const char *Modifier=nullptr)
static const char * getRegisterName(MCRegister Reg)
void printPrmtMode(const MCInst *MI, int OpNum, raw_ostream &O, const char *Modifier=nullptr)
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 printMmaCode(const MCInst *MI, int OpNum, raw_ostream &O, const char *Modifier=nullptr)
NVPTXInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
StringRef - Represent a constant reference to a string, i.e.
constexpr bool empty() const
empty - Check if the string is empty.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
SmallVectorImpl< T >::const_pointer c_str(SmallVectorImpl< T > &str)
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.