26 void AMDGPUInstPrinter::printRegOperand(
unsigned reg,
raw_ostream &O) {
49 std::pair<StringRef, StringRef>
Split =
Name.split(
'_');
53 if (SubRegName.
size() <= 4) {
66 if (SubRegName.
front() ==
'V')
68 else if (SubRegName.
front() ==
'S')
78 unsigned NumReg = Rest.
count(
'_') + 2;
79 O <<
'[' << RegIndex <<
':' << (RegIndex + NumReg - 1) <<
']';
83 void AMDGPUInstPrinter::printOperand(
const MCInst *
MI,
unsigned OpNo,
90 case AMDGPU::PRED_SEL_OFF:
94 printRegOperand(Op.
getReg(), O);
97 }
else if (Op.
isImm()) {
105 assert(!
"unknown operand type in printOperand");
109 void AMDGPUInstPrinter::printInterpSlot(
const MCInst *MI,
unsigned OpNum,
115 }
else if (Imm == 1) {
117 }
else if (Imm == 0) {
120 assert(!
"Invalid interpolation parameter slot");
124 void AMDGPUInstPrinter::printMemOperand(
const MCInst *MI,
unsigned OpNo,
126 printOperand(MI, OpNo, O);
128 printOperand(MI, OpNo + 1, O);
131 void AMDGPUInstPrinter::printIfSet(
const MCInst *MI,
unsigned OpNo,
143 void AMDGPUInstPrinter::printAbs(
const MCInst *MI,
unsigned OpNo,
145 printIfSet(MI, OpNo, O,
"|");
148 void AMDGPUInstPrinter::printClamp(
const MCInst *MI,
unsigned OpNo,
150 printIfSet(MI, OpNo, O,
"_SAT");
153 void AMDGPUInstPrinter::printLiteral(
const MCInst *MI,
unsigned OpNo,
161 O << L.i <<
"(" << L.f <<
")";
164 void AMDGPUInstPrinter::printLast(
const MCInst *MI,
unsigned OpNo,
169 void AMDGPUInstPrinter::printNeg(
const MCInst *MI,
unsigned OpNo,
171 printIfSet(MI, OpNo, O,
"-");
174 void AMDGPUInstPrinter::printOMOD(
const MCInst *MI,
unsigned OpNo,
190 void AMDGPUInstPrinter::printRel(
const MCInst *MI,
unsigned OpNo,
192 printIfSet(MI, OpNo, O,
"+");
195 void AMDGPUInstPrinter::printUpdateExecMask(
const MCInst *MI,
unsigned OpNo,
197 printIfSet(MI, OpNo, O,
"ExecMask,");
200 void AMDGPUInstPrinter::printUpdatePred(
const MCInst *MI,
unsigned OpNo,
202 printIfSet(MI, OpNo, O,
"Pred,");
205 void AMDGPUInstPrinter::printWrite(
const MCInst *MI,
unsigned OpNo,
213 void AMDGPUInstPrinter::printSel(
const MCInst *MI,
unsigned OpNo,
215 const char * chans =
"XYZW";
225 O << cb <<
"[" << sel <<
"]";
226 }
else if (sel >= 448) {
229 }
else if (sel >= 0){
234 O <<
"." << chans[chan];
237 void AMDGPUInstPrinter::printBankSwizzle(
const MCInst *MI,
unsigned OpNo,
240 switch (BankSwizzle) {
242 O <<
"BS:VEC_021/SCL_122";
245 O <<
"BS:VEC_120/SCL_212";
248 O <<
"BS:VEC_102/SCL_221";
262 void AMDGPUInstPrinter::printRSel(
const MCInst *MI,
unsigned OpNo,
292 void AMDGPUInstPrinter::printCT(
const MCInst *MI,
unsigned OpNo,
307 void AMDGPUInstPrinter::printKCache(
const MCInst *MI,
unsigned OpNo,
310 if (KCacheMode > 0) {
312 O <<
"CB" << KCacheBank <<
":";
314 int LineSize = (KCacheMode == 1)?16:32;
315 O << KCacheAddr * 16 <<
"-" << KCacheAddr * 16 + LineSize;
319 void AMDGPUInstPrinter::printWaitFlag(
const MCInst *MI,
unsigned OpNo,
325 unsigned Vmcnt = SImm16 & 0xF;
326 unsigned Expcnt = (SImm16 >> 4) & 0xF;
327 unsigned Lgkmcnt = (SImm16 >> 8) & 0xF;
329 O <<
"vmcnt(" << Vmcnt <<
") ";
331 O <<
"expcnt(" << Expcnt <<
") ";
333 O <<
"lgkmcnt(" << Lgkmcnt <<
")";
336 #include "AMDGPUGenAsmWriter.inc"
size_t size() const
size - Get the string size.
raw_ostream & indent(unsigned NumSpaces)
indent - Insert 'NumSpaces' spaces.
virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot)
void printInstruction(const MCInst *MI, raw_ostream &O)
unsigned getReg() const
getReg - Returns the register number.
static const char * getRegisterName(unsigned RegNo)
const MCExpr * getExpr() const
size_t count(char C) const
Return the number of occurrences of C in the string.
enable_if_c< std::numeric_limits< T >::is_signed, bool >::type getAsInteger(unsigned Radix, T &Result) const
static void Split(std::vector< std::string > &V, const StringRef S)
StringRef drop_front(size_t N=1) const
Provides AMDGPU specific target descriptions.
void print(raw_ostream &OS) const
char front() const
front - Get the first character in the string.
void printAnnotation(raw_ostream &OS, StringRef Annot)
Utility function for printing annotations.
const MCOperand & getOperand(unsigned i) const
size_t GetNumBytesInBuffer() const
bool empty() const
empty - Check if the string is empty.