LLVM: lib/Target/AMDGPU/MCTargetDesc/R600InstPrinter.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
18
19using namespace llvm;
20
27
32
35 int BankSwizzle = MI->getOperand(OpNo).getImm();
36 switch (BankSwizzle) {
37 case 1:
38 O << "BS:VEC_021/SCL_122";
39 break;
40 case 2:
41 O << "BS:VEC_120/SCL_212";
42 break;
43 case 3:
44 O << "BS:VEC_102/SCL_221";
45 break;
46 case 4:
47 O << "BS:VEC_201";
48 break;
49 case 5:
50 O << "BS:VEC_210";
51 break;
52 default:
53 break;
54 }
55}
56
61
63 unsigned CT = MI->getOperand(OpNo).getImm();
64 switch (CT) {
65 case 0:
66 O << 'U';
67 break;
68 case 1:
69 O << 'N';
70 break;
71 default:
72 break;
73 }
74}
75
78 int KCacheMode = MI->getOperand(OpNo).getImm();
79 if (KCacheMode > 0) {
80 int KCacheBank = MI->getOperand(OpNo - 2).getImm();
81 O << "CB" << KCacheBank << ':';
82 int KCacheAddr = MI->getOperand(OpNo + 2).getImm();
83 int LineSize = (KCacheMode == 1) ? 16 : 32;
84 O << KCacheAddr * 16 << '-' << KCacheAddr * 16 + LineSize;
85 }
86}
87
92
97 if (Op.isImm()) {
98 int64_t Imm = Op.getImm();
99 O << Imm << '(' << llvm::bit_cast(static_cast<uint32_t>(Imm)) << ')';
100 }
101 if (Op.isExpr()) {
102 O << '@';
103 MAI.printExpr(O, *Op.getExpr());
104 }
105}
106
111
114 switch (MI->getOperand(OpNo).getImm()) {
115 default:
116 break;
117 case 1:
118 O << " * 2.0";
119 break;
120 case 2:
121 O << " * 4.0";
122 break;
123 case 3:
124 O << " / 2.0";
125 break;
126 }
127}
128
135
138 if (OpNo >= MI->getNumOperands()) {
139 O << "/*Missing OP" << OpNo << "*/";
140 return;
141 }
142
144 if (Op.isReg()) {
145 switch (Op.getReg().id()) {
146
147 case R600::PRED_SEL_OFF:
148 break;
149
150 default:
152 break;
153 }
154 } else if (Op.isImm()) {
155 O << Op.getImm();
156 } else if (Op.isDFPImm()) {
157
158 if (Op.getDFPImm() == 0.0)
159 O << "0.0";
160 else {
161 O << bit_cast(Op.getDFPImm());
162 }
163 } else if (Op.isExpr()) {
164 const MCExpr *Exp = Op.getExpr();
165 MAI.printExpr(O, *Exp);
166 } else {
167 O << "/*INV_OP*/";
168 }
169}
170
175
178 unsigned Sel = MI->getOperand(OpNo).getImm();
179 switch (Sel) {
180 case 0:
181 O << 'X';
182 break;
183 case 1:
184 O << 'Y';
185 break;
186 case 2:
187 O << 'Z';
188 break;
189 case 3:
190 O << 'W';
191 break;
192 case 4:
193 O << '0';
194 break;
195 case 5:
196 O << '1';
197 break;
198 case 7:
199 O << '_';
200 break;
201 default:
202 break;
203 }
204}
205
210
215
219 if (Op.getImm() == 0) {
220 O << " (MASKED)";
221 }
222}
223
224#include "R600GenAsmWriter.inc"
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Provides R600 specific target descriptions.
static void printIfSet(const MCInst *MI, unsigned OpNo, raw_ostream &O, StringRef Asm, StringRef Default="")
Base class for the full range of assembler expressions which are needed for parsing.
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.
Generic base class for all target subtargets.
static const char * getRegisterName(MCRegister Reg)
void printAbs(const MCInst *MI, unsigned OpNo, raw_ostream &O)
Definition R600InstPrinter.cpp:28
void printClamp(const MCInst *MI, unsigned OpNo, raw_ostream &O)
Definition R600InstPrinter.cpp:57
void printUpdateExecMask(const MCInst *MI, unsigned OpNo, raw_ostream &O)
Definition R600InstPrinter.cpp:206
void printRel(const MCInst *MI, unsigned OpNo, raw_ostream &O)
Definition R600InstPrinter.cpp:171
void printRSel(const MCInst *MI, unsigned OpNo, raw_ostream &O)
Definition R600InstPrinter.cpp:176
void printNeg(const MCInst *MI, unsigned OpNo, raw_ostream &O)
Definition R600InstPrinter.cpp:107
void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
Definition R600InstPrinter.cpp:136
void printOMOD(const MCInst *MI, unsigned OpNo, raw_ostream &O)
Definition R600InstPrinter.cpp:112
void printUpdatePred(const MCInst *MI, unsigned OpNo, raw_ostream &O)
Definition R600InstPrinter.cpp:211
void printLiteral(const MCInst *MI, unsigned OpNo, raw_ostream &O)
Definition R600InstPrinter.cpp:93
void printInstruction(const MCInst *MI, uint64_t Address, raw_ostream &O)
void printWrite(const MCInst *MI, unsigned OpNo, raw_ostream &O)
Definition R600InstPrinter.cpp:216
void printCT(const MCInst *MI, unsigned OpNo, raw_ostream &O)
Definition R600InstPrinter.cpp:62
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.
Definition R600InstPrinter.cpp:21
void printMemOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
Definition R600InstPrinter.cpp:129
void printLast(const MCInst *MI, unsigned OpNo, raw_ostream &O)
Definition R600InstPrinter.cpp:88
void printKCache(const MCInst *MI, unsigned OpNo, raw_ostream &O)
Definition R600InstPrinter.cpp:76
void printBankSwizzle(const MCInst *MI, unsigned OpNo, raw_ostream &O)
Definition R600InstPrinter.cpp:33
StringRef - Represent a constant reference to a string, i.e.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
DWARFExpression::Operation Op