1 //===-- AMDGPUInstPrinter.h - AMDGPU MC Inst -> ASM interface ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_AMDGPU_INSTPRINTER_AMDGPUINSTPRINTER_H
14 #define LLVM_LIB_TARGET_AMDGPU_INSTPRINTER_AMDGPUINSTPRINTER_H
16 #include "llvm/MC/MCInstPrinter.h"
20 class AMDGPUInstPrinter
: public MCInstPrinter
{
22 AMDGPUInstPrinter(const MCAsmInfo
&MAI
, const MCInstrInfo
&MII
,
23 const MCRegisterInfo
&MRI
)
24 : MCInstPrinter(MAI
, MII
, MRI
) {}
26 //Autogenerated by tblgen
27 void printInstruction(const MCInst
*MI
, const MCSubtargetInfo
&STI
,
29 static const char *getRegisterName(unsigned RegNo
);
31 void printInst(const MCInst
*MI
, raw_ostream
&O
, StringRef Annot
,
32 const MCSubtargetInfo
&STI
) override
;
33 static void printRegOperand(unsigned RegNo
, raw_ostream
&O
,
34 const MCRegisterInfo
&MRI
);
37 void printU4ImmOperand(const MCInst
*MI
, unsigned OpNo
,
38 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
39 void printU8ImmOperand(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
);
40 void printU16ImmOperand(const MCInst
*MI
, unsigned OpNo
,
41 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
42 void printU4ImmDecOperand(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
);
43 void printU8ImmDecOperand(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
);
44 void printU16ImmDecOperand(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
);
45 void printS16ImmDecOperand(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
);
46 void printU32ImmOperand(const MCInst
*MI
, unsigned OpNo
,
47 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
48 void printNamedBit(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
,
50 void printOffen(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
);
51 void printIdxen(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
);
52 void printAddr64(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
);
53 void printMBUFOffset(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
);
54 void printOffset(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
56 void printOffsetS13(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
59 void printOffset0(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
61 void printOffset1(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
63 void printSMRDOffset8(const MCInst
*MI
, unsigned OpNo
,
64 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
65 void printSMRDOffset20(const MCInst
*MI
, unsigned OpNo
,
66 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
67 void printSMRDLiteralOffset(const MCInst
*MI
, unsigned OpNo
,
68 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
69 void printGDS(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
71 void printGLC(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
73 void printSLC(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
75 void printTFE(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
77 void printDMask(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
79 void printUNorm(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
81 void printDA(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
83 void printR128(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
85 void printLWE(const MCInst
*MI
, unsigned OpNo
,
86 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
87 void printExpCompr(const MCInst
*MI
, unsigned OpNo
,
88 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
89 void printExpVM(const MCInst
*MI
, unsigned OpNo
,
90 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
91 void printDFMT(const MCInst
*MI
, unsigned OpNo
,
92 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
93 void printNFMT(const MCInst
*MI
, unsigned OpNo
,
94 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
96 void printRegOperand(unsigned RegNo
, raw_ostream
&O
);
97 void printVOPDst(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
99 void printImmediate16(uint32_t Imm
, const MCSubtargetInfo
&STI
,
101 void printImmediateV216(uint32_t Imm
, const MCSubtargetInfo
&STI
,
103 void printImmediate32(uint32_t Imm
, const MCSubtargetInfo
&STI
,
105 void printImmediate64(uint64_t Imm
, const MCSubtargetInfo
&STI
,
107 void printOperand(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
109 void printOperandAndFPInputMods(const MCInst
*MI
, unsigned OpNo
,
110 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
111 void printOperandAndIntInputMods(const MCInst
*MI
, unsigned OpNo
,
112 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
113 void printDPPCtrl(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
115 void printRowMask(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
117 void printBankMask(const MCInst
*MI
, unsigned OpNo
,
118 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
119 void printBoundCtrl(const MCInst
*MI
, unsigned OpNo
,
120 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
121 void printSDWASel(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
);
122 void printSDWADstSel(const MCInst
*MI
, unsigned OpNo
,
123 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
124 void printSDWASrc0Sel(const MCInst
*MI
, unsigned OpNo
,
125 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
126 void printSDWASrc1Sel(const MCInst
*MI
, unsigned OpNo
,
127 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
128 void printSDWADstUnused(const MCInst
*MI
, unsigned OpNo
,
129 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
130 void printPackedModifier(const MCInst
*MI
, StringRef Name
, unsigned Mod
,
132 void printOpSel(const MCInst
*MI
, unsigned OpNo
,
133 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
134 void printOpSelHi(const MCInst
*MI
, unsigned OpNo
,
135 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
136 void printNegLo(const MCInst
*MI
, unsigned OpNo
,
137 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
138 void printNegHi(const MCInst
*MI
, unsigned OpNo
,
139 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
140 void printInterpSlot(const MCInst
*MI
, unsigned OpNo
,
141 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
142 void printInterpAttr(const MCInst
*MI
, unsigned OpNo
,
143 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
144 void printInterpAttrChan(const MCInst
*MI
, unsigned OpNo
,
145 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
147 void printVGPRIndexMode(const MCInst
*MI
, unsigned OpNo
,
148 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
149 void printMemOperand(const MCInst
*MI
, unsigned OpNo
,
150 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
153 template <unsigned N
>
154 void printExpSrcN(const MCInst
*MI
, unsigned OpNo
,
155 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
156 void printExpSrc0(const MCInst
*MI
, unsigned OpNo
,
157 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
158 void printExpSrc1(const MCInst
*MI
, unsigned OpNo
,
159 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
160 void printExpSrc2(const MCInst
*MI
, unsigned OpNo
,
161 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
162 void printExpSrc3(const MCInst
*MI
, unsigned OpNo
,
163 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
164 void printExpTgt(const MCInst
*MI
, unsigned OpNo
,
165 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
167 static void printIfSet(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
,
168 StringRef Asm
, StringRef Default
= "");
169 static void printIfSet(const MCInst
*MI
, unsigned OpNo
, raw_ostream
&O
,
171 void printAbs(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
173 void printClamp(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
175 void printClampSI(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
177 void printOModSI(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
179 void printLiteral(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
181 void printLast(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
183 void printNeg(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
185 void printOMOD(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
187 void printRel(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
189 void printUpdateExecMask(const MCInst
*MI
, unsigned OpNo
,
190 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
191 void printUpdatePred(const MCInst
*MI
, unsigned OpNo
,
192 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
193 void printWrite(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
195 void printBankSwizzle(const MCInst
*MI
, unsigned OpNo
,
196 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
197 void printRSel(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
199 void printCT(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
201 void printKCache(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
203 void printSendMsg(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
205 void printSwizzle(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
207 void printWaitFlag(const MCInst
*MI
, unsigned OpNo
,
208 const MCSubtargetInfo
&STI
, raw_ostream
&O
);
209 void printHwreg(const MCInst
*MI
, unsigned OpNo
, const MCSubtargetInfo
&STI
,
213 } // End namespace llvm