Go to the documentation of this file.
22 #define DEBUG_TYPE "asm-printer"
24 #include "SystemZGenAsmWriter.inc"
79 int64_t
Value =
MI->getOperand(OpNum).getImm();
80 assert(isUInt<N>(
Value) &&
"Invalid uimm argument");
86 int64_t
Value =
MI->getOperand(OpNum).getImm();
91 void SystemZInstPrinter::printU1ImmOperand(
const MCInst *
MI,
int OpNum,
93 printUImmOperand<1>(
MI, OpNum,
O);
96 void SystemZInstPrinter::printU2ImmOperand(
const MCInst *
MI,
int OpNum,
98 printUImmOperand<2>(
MI, OpNum,
O);
101 void SystemZInstPrinter::printU3ImmOperand(
const MCInst *
MI,
int OpNum,
103 printUImmOperand<3>(
MI, OpNum,
O);
106 void SystemZInstPrinter::printU4ImmOperand(
const MCInst *
MI,
int OpNum,
108 printUImmOperand<4>(
MI, OpNum,
O);
111 void SystemZInstPrinter::printU6ImmOperand(
const MCInst *
MI,
int OpNum,
113 printUImmOperand<6>(
MI, OpNum,
O);
116 void SystemZInstPrinter::printS8ImmOperand(
const MCInst *
MI,
int OpNum,
118 printSImmOperand<8>(
MI, OpNum,
O);
121 void SystemZInstPrinter::printU8ImmOperand(
const MCInst *
MI,
int OpNum,
123 printUImmOperand<8>(
MI, OpNum,
O);
126 void SystemZInstPrinter::printU12ImmOperand(
const MCInst *
MI,
int OpNum,
128 printUImmOperand<12>(
MI, OpNum,
O);
131 void SystemZInstPrinter::printS16ImmOperand(
const MCInst *
MI,
int OpNum,
133 printSImmOperand<16>(
MI, OpNum,
O);
136 void SystemZInstPrinter::printU16ImmOperand(
const MCInst *
MI,
int OpNum,
138 printUImmOperand<16>(
MI, OpNum,
O);
141 void SystemZInstPrinter::printS32ImmOperand(
const MCInst *
MI,
int OpNum,
143 printSImmOperand<32>(
MI, OpNum,
O);
146 void SystemZInstPrinter::printU32ImmOperand(
const MCInst *
MI,
int OpNum,
148 printUImmOperand<32>(
MI, OpNum,
O);
151 void SystemZInstPrinter::printU48ImmOperand(
const MCInst *
MI,
int OpNum,
153 printUImmOperand<48>(
MI, OpNum,
O);
156 void SystemZInstPrinter::printPCRelOperand(
const MCInst *
MI,
int OpNum,
166 void SystemZInstPrinter::printPCRelTLSOperand(
const MCInst *
MI,
170 printPCRelOperand(
MI, OpNum,
O);
173 if ((
unsigned)OpNum + 1 <
MI->getNumOperands()) {
195 void SystemZInstPrinter::printBDAddrOperand(
const MCInst *
MI,
int OpNum,
201 void SystemZInstPrinter::printBDXAddrOperand(
const MCInst *
MI,
int OpNum,
204 MI->getOperand(OpNum + 2).getReg(),
O);
207 void SystemZInstPrinter::printBDLAddrOperand(
const MCInst *
MI,
int OpNum,
209 unsigned Base =
MI->getOperand(OpNum).getReg();
210 const MCOperand &DispMO =
MI->getOperand(OpNum + 1);
211 uint64_t Length =
MI->getOperand(OpNum + 2).getImm();
221 void SystemZInstPrinter::printBDRAddrOperand(
const MCInst *
MI,
int OpNum,
223 unsigned Base =
MI->getOperand(OpNum).getReg();
224 const MCOperand &DispMO =
MI->getOperand(OpNum + 1);
225 unsigned Length =
MI->getOperand(OpNum + 2).getReg();
236 void SystemZInstPrinter::printBDVAddrOperand(
const MCInst *
MI,
int OpNum,
239 MI->getOperand(OpNum + 2).getReg(),
O);
242 void SystemZInstPrinter::printCond4Operand(
const MCInst *
MI,
int OpNum,
244 static const char *
const CondNames[] = {
245 "o",
"h",
"nle",
"l",
"nhe",
"lh",
"ne",
246 "e",
"nlh",
"he",
"nl",
"le",
"nh",
"no"
248 uint64_t Imm =
MI->getOperand(OpNum).getImm();
249 assert(Imm > 0 && Imm < 15 &&
"Invalid condition");
250 O << CondNames[Imm - 1];
VariantKind getKind() const
This is an optimization pass for GlobalISel generic memory operations.
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.
This class is intended to be used as a base class for asm properties and features specific to the tar...
static const char * getRegisterName(unsigned RegNo)
unsigned getAssemblerDialect() const
Instances of this class represent a single low-level machine instruction.
static void printOperand(const MCOperand &MO, const MCAsmInfo *MAI, raw_ostream &O)
static void printSImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
This class implements an extremely fast bulk output stream that can only output to a stream.
const MCSymbol & getSymbol() const
StringRef getName() const
getName - Get the symbol name.
static void printUImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
void printAnnotation(raw_ostream &OS, StringRef Annot)
Utility function for printing annotations.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Represent a reference to a symbol from inside an expression.
StringRef - Represent a constant reference to a string, i.e.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void printInstruction(const MCInst *MI, uint64_t Address, raw_ostream &O)
static void printAddress(const MCAsmInfo *MAI, unsigned Base, const MCOperand &DispMO, unsigned Index, raw_ostream &O)
const MCExpr * getExpr() const
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
Instances of this class represent operands of the MCInst class.
static void printFormattedRegName(const MCAsmInfo *MAI, unsigned RegNo, raw_ostream &O)
void printRegName(raw_ostream &O, unsigned RegNo) const override
Print the assembler register name.
Generic base class for all target subtargets.
LLVM Value Representation.
unsigned getReg() const
Returns the register number.