23#define DEBUG_TYPE "asm-printer"
25#include "SystemZGenAsmWriter.inc"
84void SystemZInstPrinter::printUImmOperand(
const MCInst *
MI,
int OpNum,
92 assert(isUInt<N>(
Value) &&
"Invalid uimm argument");
97void SystemZInstPrinter::printSImmOperand(
const MCInst *
MI,
int OpNum,
104 int64_t
Value =
MI->getOperand(OpNum).getImm();
105 assert(isInt<N>(
Value) &&
"Invalid simm argument");
109void SystemZInstPrinter::printU1ImmOperand(
const MCInst *
MI,
int OpNum,
111 printUImmOperand<1>(
MI, OpNum, O);
114void SystemZInstPrinter::printU2ImmOperand(
const MCInst *
MI,
int OpNum,
116 printUImmOperand<2>(
MI, OpNum, O);
119void SystemZInstPrinter::printU3ImmOperand(
const MCInst *
MI,
int OpNum,
121 printUImmOperand<3>(
MI, OpNum, O);
124void SystemZInstPrinter::printU4ImmOperand(
const MCInst *
MI,
int OpNum,
126 printUImmOperand<4>(
MI, OpNum, O);
129void SystemZInstPrinter::printS8ImmOperand(
const MCInst *
MI,
int OpNum,
131 printSImmOperand<8>(
MI, OpNum, O);
134void SystemZInstPrinter::printU8ImmOperand(
const MCInst *
MI,
int OpNum,
136 printUImmOperand<8>(
MI, OpNum, O);
139void SystemZInstPrinter::printU12ImmOperand(
const MCInst *
MI,
int OpNum,
141 printUImmOperand<12>(
MI, OpNum, O);
144void SystemZInstPrinter::printS16ImmOperand(
const MCInst *
MI,
int OpNum,
146 printSImmOperand<16>(
MI, OpNum, O);
149void SystemZInstPrinter::printU16ImmOperand(
const MCInst *
MI,
int OpNum,
151 printUImmOperand<16>(
MI, OpNum, O);
154void SystemZInstPrinter::printS32ImmOperand(
const MCInst *
MI,
int OpNum,
156 printSImmOperand<32>(
MI, OpNum, O);
159void SystemZInstPrinter::printU32ImmOperand(
const MCInst *
MI,
int OpNum,
161 printUImmOperand<32>(
MI, OpNum, O);
164void SystemZInstPrinter::printU48ImmOperand(
const MCInst *
MI,
int OpNum,
166 printUImmOperand<48>(
MI, OpNum, O);
169void SystemZInstPrinter::printPCRelOperand(
const MCInst *
MI,
int OpNum,
180void SystemZInstPrinter::printPCRelTLSOperand(
const MCInst *
MI,
184 printPCRelOperand(
MI, OpNum, O);
187 if ((
unsigned)OpNum + 1 <
MI->getNumOperands()) {
209void SystemZInstPrinter::printBDAddrOperand(
const MCInst *
MI,
int OpNum,
215void SystemZInstPrinter::printBDXAddrOperand(
const MCInst *
MI,
int OpNum,
218 MI->getOperand(OpNum + 2).getReg(), O);
221void SystemZInstPrinter::printBDLAddrOperand(
const MCInst *
MI,
int OpNum,
223 unsigned Base =
MI->getOperand(OpNum).getReg();
224 const MCOperand &DispMO =
MI->getOperand(OpNum + 1);
235void SystemZInstPrinter::printBDRAddrOperand(
const MCInst *
MI,
int OpNum,
237 unsigned Base =
MI->getOperand(OpNum).getReg();
238 const MCOperand &DispMO =
MI->getOperand(OpNum + 1);
239 unsigned Length =
MI->getOperand(OpNum + 2).getReg();
250void SystemZInstPrinter::printBDVAddrOperand(
const MCInst *
MI,
int OpNum,
253 MI->getOperand(OpNum + 2).getReg(), O);
256void SystemZInstPrinter::printCond4Operand(
const MCInst *
MI,
int OpNum,
258 static const char *
const CondNames[] = {
259 "o",
"h",
"nle",
"l",
"nhe",
"lh",
"ne",
260 "e",
"nlh",
"he",
"nl",
"le",
"nh",
"no"
263 assert(Imm > 0 && Imm < 15 &&
"Invalid condition");
264 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.