23#define DEBUG_TYPE "asm-printer"
25#include "SystemZGenAsmWriter.inc"
85void SystemZInstPrinter::printUImmOperand(
const MCInst *
MI,
int OpNum,
93 assert(isUInt<N>(
Value) &&
"Invalid uimm argument");
98void SystemZInstPrinter::printSImmOperand(
const MCInst *
MI,
int OpNum,
105 int64_t
Value =
MI->getOperand(OpNum).getImm();
106 assert(isInt<N>(
Value) &&
"Invalid simm argument");
110void SystemZInstPrinter::printU1ImmOperand(
const MCInst *
MI,
int OpNum,
112 printUImmOperand<1>(
MI, OpNum, O);
115void SystemZInstPrinter::printU2ImmOperand(
const MCInst *
MI,
int OpNum,
117 printUImmOperand<2>(
MI, OpNum, O);
120void SystemZInstPrinter::printU3ImmOperand(
const MCInst *
MI,
int OpNum,
122 printUImmOperand<3>(
MI, OpNum, O);
125void SystemZInstPrinter::printU4ImmOperand(
const MCInst *
MI,
int OpNum,
127 printUImmOperand<4>(
MI, OpNum, O);
130void SystemZInstPrinter::printS8ImmOperand(
const MCInst *
MI,
int OpNum,
132 printSImmOperand<8>(
MI, OpNum, O);
135void SystemZInstPrinter::printU8ImmOperand(
const MCInst *
MI,
int OpNum,
137 printUImmOperand<8>(
MI, OpNum, O);
140void SystemZInstPrinter::printU12ImmOperand(
const MCInst *
MI,
int OpNum,
142 printUImmOperand<12>(
MI, OpNum, O);
145void SystemZInstPrinter::printS16ImmOperand(
const MCInst *
MI,
int OpNum,
147 printSImmOperand<16>(
MI, OpNum, O);
150void SystemZInstPrinter::printU16ImmOperand(
const MCInst *
MI,
int OpNum,
152 printUImmOperand<16>(
MI, OpNum, O);
155void SystemZInstPrinter::printS32ImmOperand(
const MCInst *
MI,
int OpNum,
157 printSImmOperand<32>(
MI, OpNum, O);
160void SystemZInstPrinter::printU32ImmOperand(
const MCInst *
MI,
int OpNum,
162 printUImmOperand<32>(
MI, OpNum, O);
165void SystemZInstPrinter::printU48ImmOperand(
const MCInst *
MI,
int OpNum,
167 printUImmOperand<48>(
MI, OpNum, O);
170void SystemZInstPrinter::printPCRelOperand(
const MCInst *
MI,
int OpNum,
181void SystemZInstPrinter::printPCRelTLSOperand(
const MCInst *
MI,
185 printPCRelOperand(
MI, OpNum, O);
188 if ((
unsigned)OpNum + 1 <
MI->getNumOperands()) {
210void SystemZInstPrinter::printBDAddrOperand(
const MCInst *
MI,
int OpNum,
216void SystemZInstPrinter::printBDXAddrOperand(
const MCInst *
MI,
int OpNum,
219 MI->getOperand(OpNum + 2).getReg(), O);
222void SystemZInstPrinter::printBDLAddrOperand(
const MCInst *
MI,
int OpNum,
224 unsigned Base =
MI->getOperand(OpNum).getReg();
225 const MCOperand &DispMO =
MI->getOperand(OpNum + 1);
236void SystemZInstPrinter::printBDRAddrOperand(
const MCInst *
MI,
int OpNum,
238 unsigned Base =
MI->getOperand(OpNum).getReg();
239 const MCOperand &DispMO =
MI->getOperand(OpNum + 1);
240 unsigned Length =
MI->getOperand(OpNum + 2).getReg();
251void SystemZInstPrinter::printBDVAddrOperand(
const MCInst *
MI,
int OpNum,
254 MI->getOperand(OpNum + 2).getReg(), O);
257void SystemZInstPrinter::printCond4Operand(
const MCInst *
MI,
int OpNum,
259 static const char *
const CondNames[] = {
260 "o",
"h",
"nle",
"l",
"nhe",
"lh",
"ne",
261 "e",
"nlh",
"he",
"nl",
"le",
"nh",
"no"
264 assert(Imm > 0 && Imm < 15 &&
"Invalid condition");
265 O << CondNames[
Imm - 1];
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This class is intended to be used as a base class for asm properties and features specific to the tar...
unsigned getAssemblerDialect() const
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
WithMarkup markup(raw_ostream &OS, Markup M) const
void printAnnotation(raw_ostream &OS, StringRef Annot)
Utility function for printing annotations.
Instances of this class represent a single low-level machine instruction.
Instances of this class represent operands of the MCInst class.
unsigned getReg() const
Returns the register number.
const MCExpr * getExpr() const
Wrapper class representing physical registers. Should be passed by value.
Generic base class for all target subtargets.
Represent a reference to a symbol from inside an expression.
const MCSymbol & getSymbol() const
VariantKind getKind() const
StringRef getName() const
getName - Get the symbol name.
StringRef - Represent a constant reference to a string, i.e.
void printRegName(raw_ostream &O, MCRegister Reg) const override
Print the assembler register name.
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.
void printOperand(const MCOperand &MO, const MCAsmInfo *MAI, raw_ostream &O)
void printAddress(const MCAsmInfo *MAI, MCRegister Base, const MCOperand &DispMO, MCRegister Index, raw_ostream &O)
void printFormattedRegName(const MCAsmInfo *MAI, MCRegister Reg, raw_ostream &O) const
static const char * getRegisterName(MCRegister Reg)
void printInstruction(const MCInst *MI, uint64_t Address, raw_ostream &O)
LLVM Value Representation.
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.