29#define DEBUG_TYPE "asm-printer"
31#include "NVPTXGenAsmWriter.inc"
40 unsigned RCId = (Reg.id() >> 28);
71 unsigned VReg = Reg.id() & 0x0FFFFFFF;
90 }
else if (
Op.isImm()) {
93 assert(
Op.isExpr() &&
"Unknown operand kind in printOperand");
94 MAI.printExpr(O, *
Op.getExpr());
101 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 const int Imm = MO.
getImm();
168 int64_t Imm = MO.
getImm();
170 if (Modifier ==
"FCmp") {
218 if (Modifier ==
"ICmp") {
246 if (Modifier ==
"IType") {
274 int Imm = (int)MO.
getImm();
275 if (Modifier ==
"sem") {
294 "NVPTX AtomicCode Printer does not support \"seq_cst\" ordering.");
300 O <<
".mmio.relaxed";
303 }
else if (Modifier ==
"scope") {
323 "NVPTX AtomicCode Printer does not support \"{}\" scope modifier.",
325 }
else if (Modifier ==
"addsp") {
340 "NVPTX AtomicCode Printer does not support \"{}\" addsp modifier.",
341 AddressSpaceToString(
A)));
342 }
else if (Modifier ==
"sign") {
366 int Imm = (int)MO.
getImm();
367 if (Modifier.
empty() || Modifier ==
"version") {
370 }
else if (Modifier ==
"aligned") {
383 if (Modifier ==
"add") {
387 if (
MI->getOperand(OpNum + 1).isImm() &&
388 MI->getOperand(OpNum + 1).getImm() == 0)
397 int64_t Imm =
MI->getOperand(OpNum).getImm();
404 assert(
Op.isExpr() &&
"Call prototype is not an MCExpr?");
413 int64_t Imm = MO.
getImm();
446 switch (
static_cast<RedTy
>(MO.
getImm())) {
473 "Invalid Reduction Op in printCpAsyncBulkTensorReductionMode");
481 switch (
static_cast<CGTy
>(MO.
getImm())) {
486 O <<
".cta_group::1";
489 O <<
".cta_group::2";
499 const auto Imm = MO.
getImm();
501 if (Modifier ==
"RetList") {
502 assert((Imm == 1 || Imm == 0) &&
"Invalid return list");
508 if (Modifier ==
"ParamList") {
509 assert(Imm >= 0 &&
"Invalid parameter list");
511 [&](
const auto &
I) { O <<
"param" <<
I; });
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
This file contains the definitions of the enumerations and flags associated with NVVM Intrinsics,...
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.
WithMarkup markup(raw_ostream &OS, Markup M)
format_object< int64_t > formatHex(int64_t Value) const
const MCRegisterInfo & MRI
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.
MCInstPrinter(const MCAsmInfo &mai, const MCInstrInfo &mii, const MCRegisterInfo &mri)
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 ...
StringRef getName() const
getName - Get the symbol name.
void printFTZFlag(const MCInst *MI, int OpNum, raw_ostream &O)
void printCmpMode(const MCInst *MI, int OpNum, raw_ostream &O, StringRef Modifier={})
void printRegName(raw_ostream &OS, MCRegister Reg) override
Print the assembler register name.
void printHexu32imm(const MCInst *MI, int OpNum, raw_ostream &O)
void printCTAGroup(const MCInst *MI, int OpNum, raw_ostream &O)
void printCvtMode(const MCInst *MI, int OpNum, raw_ostream &O, StringRef Modifier={})
void printMmaCode(const MCInst *MI, int OpNum, raw_ostream &O, StringRef Modifier={})
void printInstruction(const MCInst *MI, uint64_t Address, raw_ostream &O)
void printProtoIdent(const MCInst *MI, int OpNum, raw_ostream &O)
void printAtomicCode(const MCInst *MI, int OpNum, raw_ostream &O, StringRef Modifier={})
static const char * getRegisterName(MCRegister Reg)
void printCallOperand(const MCInst *MI, int OpNum, raw_ostream &O, StringRef Modifier={})
void printTmaReductionMode(const MCInst *MI, int OpNum, raw_ostream &O)
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.
NVPTXInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
void printPrmtMode(const MCInst *MI, int OpNum, raw_ostream &O)
void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printMemOperand(const MCInst *MI, int OpNum, raw_ostream &O, StringRef Modifier={})
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)
void interleaveComma(const Container &c, StreamT &os, UnaryFunctor each_fn)
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
DWARFExpression::Operation Op
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
auto seq(T Begin, T End)
Iterate over an integral type from Begin up to - but not including - End.