LLVM: lib/Target/SystemZ/MCTargetDesc/SystemZInstPrinterCommon.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
19#include
20#include
21
22using namespace llvm;
23
24#define DEBUG_TYPE "asm-printer"
25
31 if (Base || Index) {
32 O << '(';
33 if (Index) {
35 O << ',';
36 }
39 else
40 O << '0';
41 O << ')';
42 }
43}
44
50 O << '0';
51 else
53 } else if (MO.isImm())
57 else
59}
60
64
65template
68 const MCOperand &MO = MI->getOperand(OpNum);
71 return;
72 }
76}
77
78template
81 const MCOperand &MO = MI->getOperand(OpNum);
84 return;
85 }
86 int64_t Value = MI->getOperand(OpNum).getImm();
89}
90
95
100
105
110
115
120
125
130
135
140
145
150
154 const MCOperand &MO = MI->getOperand(OpNum);
155
156
157
158 if (MO.isImm()) {
162 else
164 return;
165 }
166
167
169 int64_t TargetAddress;
170 if (BranchTarget && BranchTarget->evaluateAsAbsolute(TargetAddress)) {
172 } else {
173
175 }
176}
177
181
183
184
185 if ((unsigned)OpNum + 1 < MI->getNumOperands()) {
186 const MCOperand &MO = MI->getOperand(OpNum + 1);
190 O << ":tls_gdcall:";
191 break;
193 O << ":tls_ldcall:";
194 break;
195 default:
197 }
199 }
200}
201
206
209 printAddress(&MAI, MI->getOperand(OpNum).getReg(), MI->getOperand(OpNum + 1),
210 0, O);
211}
212
215 printAddress(&MAI, MI->getOperand(OpNum).getReg(), MI->getOperand(OpNum + 1),
216 MI->getOperand(OpNum + 2).getReg(), O);
217}
218
222 const MCOperand &DispMO = MI->getOperand(OpNum + 1);
227 O << ",";
229 }
230 O << ')';
231}
232
236 const MCOperand &DispMO = MI->getOperand(OpNum + 1);
239 O << "(";
242 O << ",";
244 }
245 O << ')';
246}
247
250 printAddress(&MAI, MI->getOperand(OpNum).getReg(), MI->getOperand(OpNum + 1),
251 MI->getOperand(OpNum + 2).getReg(), O);
252}
253
256 printAddress(&MAI, MI->getOperand(OpNum).getReg(), MI->getOperand(OpNum + 1),
257 MI->getOperand(OpNum + 2).getReg(), O);
258}
259
262 static const char *const CondNames[] = {"o", "h", "nle", "l", "nhe",
263 "lh", "ne", "e", "nlh", "he",
264 "nl", "le", "nh", "no"};
265 uint64_t Imm = MI->getOperand(OpNum).getImm();
266 assert(Imm > 0 && Imm < 15 && "Invalid condition");
267 O << CondNames[Imm - 1];
268}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This class is intended to be used as a base class for asm properties and features specific to the tar...
WithMarkup markup(raw_ostream &OS, Markup M)
format_object< int64_t > formatHex(int64_t Value) const
format_object< int64_t > formatImm(int64_t Value) const
Utility function to print immediates in decimal or hex.
bool PrintBranchImmAsAddress
If true, a branch immediate (e.g.
Instances of this class represent a single low-level machine instruction.
Instances of this class represent operands of the MCInst class.
MCRegister getReg() const
Returns the register number.
const MCExpr * getExpr() const
Wrapper class representing physical registers. Should be passed by value.
Represent a reference to a symbol from inside an expression.
const MCSymbol & getSymbol() const
uint16_t getSpecifier() const
StringRef getName() const
getName - Get the symbol name.
void printUImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:66
void printU2ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:96
void printU3ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:101
void printBDXAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:213
void printBDVAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:248
void printU4ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:106
void printSImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:79
void printPCRelOperand(const MCInst *MI, uint64_t Address, int OpNum, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:151
void printS8ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:111
void printBDLAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:219
void printOperand(const MCOperand &MO, const MCAsmInfo *MAI, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:45
void printPCRelTLSOperand(const MCInst *MI, uint64_t Address, int OpNum, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:178
void printRegName(raw_ostream &O, MCRegister Reg) override
Print the assembler register name.
Definition SystemZInstPrinterCommon.cpp:61
virtual void printFormattedRegName(const MCAsmInfo *MAI, MCRegister Reg, raw_ostream &O)
void printLXAAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:254
void printU12ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:121
void printU32ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:141
void printBDAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:207
void printU1ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:91
void printU48ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:146
void printU8ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:116
void printAddress(const MCAsmInfo *MAI, MCRegister Base, const MCOperand &DispMO, MCRegister Index, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:26
void printCond4Operand(const MCInst *MI, int OpNum, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:260
void printBDRAddrOperand(const MCInst *MI, int OpNum, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:233
void printS32ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:136
void printS16ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:126
void printU16ImmOperand(const MCInst *MI, int OpNum, raw_ostream &O)
Definition SystemZInstPrinterCommon.cpp:131
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.
constexpr bool isInt(int64_t x)
Checks if an integer fits into the given bit width.
decltype(auto) dyn_cast(const From &Val)
dyn_cast - Return the argument parameter cast to the specified type.
constexpr bool isUInt(uint64_t x)
Checks if an unsigned integer fits into the given bit width.
decltype(auto) cast(const From &Val)
cast - Return the argument parameter cast to the specified type.