LLVM 19.0.0git
AMDGPUAsmUtils.cpp
Go to the documentation of this file.
1//===-- AMDGPUAsmUtils.cpp - AsmParser/InstPrinter common -----------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8#include "AMDGPUAsmUtils.h"
9#include "AMDGPUBaseInfo.h"
10#include "SIDefines.h"
11
12namespace llvm {
13namespace AMDGPU {
14
15//===----------------------------------------------------------------------===//
16// Custom Operands.
17//
18// A table of custom operands shall describe "primary" operand names first
19// followed by aliases if any. It is not required but recommended to arrange
20// operands so that operand encoding match operand position in the table. This
21// will make getNameFromOperandTable() a bit more efficient. Unused slots in the
22// table shall have an empty name.
23//
24//===----------------------------------------------------------------------===//
25
26/// Map from the encoding of a sendmsg/hwreg asm operand to it's name.
27template <size_t N>
29 unsigned Encoding,
30 const MCSubtargetInfo &STI) {
31 auto isValidIndexForEncoding = [&](size_t Idx) {
32 return Idx < N && Table[Idx].Encoding == Encoding &&
33 !Table[Idx].Name.empty() &&
34 (!Table[Idx].Cond || Table[Idx].Cond(STI));
35 };
36
37 // This is an optimization that should work in most cases. As a side effect,
38 // it may cause selection of an alias instead of a primary operand name in
39 // case of sparse tables.
40 if (isValidIndexForEncoding(Encoding))
41 return Table[Encoding].Name;
42
43 for (size_t Idx = 0; Idx != N; ++Idx)
44 if (isValidIndexForEncoding(Idx))
45 return Table[Idx].Name;
46
47 return "";
48}
49
50/// Map from a symbolic name for a sendmsg/hwreg asm operand to it's encoding.
51template <size_t N>
52static int64_t getEncodingFromOperandTable(const CustomOperand (&Table)[N],
54 const MCSubtargetInfo &STI) {
55 int64_t InvalidEncoding = OPR_ID_UNKNOWN;
56 for (const CustomOperand &Entry : Table) {
57 if (Entry.Name != Name)
58 continue;
59
60 if (!Entry.Cond || Entry.Cond(STI))
61 return Entry.Encoding;
62
63 InvalidEncoding = OPR_ID_UNSUPPORTED;
64 }
65
66 return InvalidEncoding;
67}
68
69namespace DepCtr {
70
71// NOLINTBEGIN
73 // Name max dflt offset width constraint
74 {{"depctr_hold_cnt"}, 1, 1, 7, 1, isGFX10_BEncoding},
75 {{"depctr_sa_sdst"}, 1, 1, 0, 1},
76 {{"depctr_va_vdst"}, 15, 15, 12, 4},
77 {{"depctr_va_sdst"}, 7, 7, 9, 3},
78 {{"depctr_va_ssrc"}, 1, 1, 8, 1},
79 {{"depctr_va_vcc"}, 1, 1, 1, 1},
80 {{"depctr_vm_vsrc"}, 7, 7, 2, 3},
81};
82// NOLINTEND
83
84const int DEP_CTR_SIZE =
85 static_cast<int>(sizeof(DepCtrInfo) / sizeof(CustomOperandVal));
86
87} // namespace DepCtr
88
89namespace SendMsg {
90
91// Disable lint checking here since it makes these tables unreadable.
92// NOLINTBEGIN
93// clang-format off
94
95static constexpr CustomOperand MsgOperands[] = {
96 {{""}},
97 {{"MSG_INTERRUPT"}, ID_INTERRUPT},
98 {{"MSG_GS"}, ID_GS_PreGFX11, isNotGFX11Plus},
99 {{"MSG_GS_DONE"}, ID_GS_DONE_PreGFX11, isNotGFX11Plus},
100 {{"MSG_SAVEWAVE"}, ID_SAVEWAVE, isGFX8_GFX9_GFX10},
101 {{"MSG_STALL_WAVE_GEN"}, ID_STALL_WAVE_GEN, isGFX9_GFX10_GFX11},
102 {{"MSG_HALT_WAVES"}, ID_HALT_WAVES, isGFX9_GFX10_GFX11},
103 {{"MSG_ORDERED_PS_DONE"}, ID_ORDERED_PS_DONE, isGFX9_GFX10},
104 {{"MSG_EARLY_PRIM_DEALLOC"}, ID_EARLY_PRIM_DEALLOC, isGFX9_GFX10},
105 {{"MSG_GS_ALLOC_REQ"}, ID_GS_ALLOC_REQ, isGFX9Plus},
106 {{"MSG_GET_DOORBELL"}, ID_GET_DOORBELL, isGFX9_GFX10},
107 {{"MSG_GET_DDID"}, ID_GET_DDID, isGFX10},
108 {{"MSG_HS_TESSFACTOR"}, ID_HS_TESSFACTOR_GFX11Plus, isGFX11Plus},
109 {{"MSG_DEALLOC_VGPRS"}, ID_DEALLOC_VGPRS_GFX11Plus, isGFX11Plus},
110 {{""}},
111 {{"MSG_SYSMSG"}, ID_SYSMSG},
112 {{"MSG_RTN_GET_DOORBELL"}, ID_RTN_GET_DOORBELL, isGFX11Plus},
113 {{"MSG_RTN_GET_DDID"}, ID_RTN_GET_DDID, isGFX11Plus},
114 {{"MSG_RTN_GET_TMA"}, ID_RTN_GET_TMA, isGFX11Plus},
115 {{"MSG_RTN_GET_REALTIME"}, ID_RTN_GET_REALTIME, isGFX11Plus},
116 {{"MSG_RTN_SAVE_WAVE"}, ID_RTN_SAVE_WAVE, isGFX11Plus},
117 {{"MSG_RTN_GET_TBA"}, ID_RTN_GET_TBA, isGFX11Plus},
118 {{"MSG_RTN_GET_TBA_TO_PC"}, ID_RTN_GET_TBA_TO_PC, isGFX11Plus},
119 {{"MSG_RTN_GET_SE_AID_ID"}, ID_RTN_GET_SE_AID_ID, isGFX12Plus},
120};
121
122static constexpr CustomOperand SysMsgOperands[] = {
123 {{""}},
124 {{"SYSMSG_OP_ECC_ERR_INTERRUPT"}, OP_SYS_ECC_ERR_INTERRUPT},
125 {{"SYSMSG_OP_REG_RD"}, OP_SYS_REG_RD},
126 {{"SYSMSG_OP_HOST_TRAP_ACK"}, OP_SYS_HOST_TRAP_ACK, isNotGFX9Plus},
127 {{"SYSMSG_OP_TTRACE_PC"}, OP_SYS_TTRACE_PC},
128};
129
130static constexpr CustomOperand StreamMsgOperands[] = {
131 {{"GS_OP_NOP"}, OP_GS_NOP},
132 {{"GS_OP_CUT"}, OP_GS_CUT},
133 {{"GS_OP_EMIT"}, OP_GS_EMIT},
134 {{"GS_OP_EMIT_CUT"}, OP_GS_EMIT_CUT},
135};
136
137// clang-format on
138// NOLINTEND
139
142}
143
145 return getNameFromOperandTable(MsgOperands, Encoding, STI);
146}
147
148int64_t getMsgOpId(int64_t MsgId, StringRef Name, const MCSubtargetInfo &STI) {
149 if (MsgId == ID_SYSMSG)
152}
153
154StringRef getMsgOpName(int64_t MsgId, uint64_t Encoding,
155 const MCSubtargetInfo &STI) {
156 assert(msgRequiresOp(MsgId, STI) && "must have an operand");
157
158 if (MsgId == ID_SYSMSG)
159 return getNameFromOperandTable(SysMsgOperands, Encoding, STI);
160 return getNameFromOperandTable(StreamMsgOperands, Encoding, STI);
161}
162
163} // namespace SendMsg
164
165namespace Hwreg {
166
167// Disable lint checking for this block since it makes the table unreadable.
168// NOLINTBEGIN
169// clang-format off
170static constexpr CustomOperand Operands[] = {
171 {{""}},
172 {{"HW_REG_MODE"}, ID_MODE},
173 {{"HW_REG_STATUS"}, ID_STATUS},
174 {{"HW_REG_TRAPSTS"}, ID_TRAPSTS, isNotGFX12Plus},
175 {{"HW_REG_HW_ID"}, ID_HW_ID, isNotGFX10Plus},
176 {{"HW_REG_GPR_ALLOC"}, ID_GPR_ALLOC},
177 {{"HW_REG_LDS_ALLOC"}, ID_LDS_ALLOC},
178 {{"HW_REG_IB_STS"}, ID_IB_STS},
179 {{""}},
180 {{""}},
181 {{"HW_REG_PERF_SNAPSHOT_DATA"}, ID_PERF_SNAPSHOT_DATA_gfx12, isGFX12Plus},
182 {{"HW_REG_PERF_SNAPSHOT_PC_LO"}, ID_PERF_SNAPSHOT_PC_LO_gfx12, isGFX12Plus},
183 {{"HW_REG_PERF_SNAPSHOT_PC_HI"}, ID_PERF_SNAPSHOT_PC_HI_gfx12, isGFX12Plus},
184 {{""}},
185 {{""}},
186 {{"HW_REG_SH_MEM_BASES"}, ID_MEM_BASES, isGFX9_GFX10_GFX11},
187 {{"HW_REG_TBA_LO"}, ID_TBA_LO, isGFX9_GFX10},
188 {{"HW_REG_TBA_HI"}, ID_TBA_HI, isGFX9_GFX10},
189 {{"HW_REG_TMA_LO"}, ID_TMA_LO, isGFX9_GFX10},
190 {{"HW_REG_TMA_HI"}, ID_TMA_HI, isGFX9_GFX10},
191 {{"HW_REG_FLAT_SCR_LO"}, ID_FLAT_SCR_LO, isGFX10_GFX11},
192 {{"HW_REG_FLAT_SCR_HI"}, ID_FLAT_SCR_HI, isGFX10_GFX11},
193 {{"HW_REG_XNACK_MASK"}, ID_XNACK_MASK, isGFX10Before1030},
194 {{"HW_REG_HW_ID1"}, ID_HW_ID1, isGFX10Plus},
195 {{"HW_REG_HW_ID2"}, ID_HW_ID2, isGFX10Plus},
196 {{"HW_REG_POPS_PACKER"}, ID_POPS_PACKER, isGFX10},
197 {{""}},
198 {{"HW_REG_PERF_SNAPSHOT_DATA"}, ID_PERF_SNAPSHOT_DATA_gfx11, isGFX11},
199 {{""}},
200 {{"HW_REG_SHADER_CYCLES"}, ID_SHADER_CYCLES, isGFX10_3_GFX11},
201 {{"HW_REG_SHADER_CYCLES_HI"}, ID_SHADER_CYCLES_HI, isGFX12Plus},
202 {{"HW_REG_DVGPR_ALLOC_LO"}, ID_DVGPR_ALLOC_LO, isGFX12Plus},
203 {{"HW_REG_DVGPR_ALLOC_HI"}, ID_DVGPR_ALLOC_HI, isGFX12Plus},
204
205 // Register numbers reused in GFX11
206 {{"HW_REG_PERF_SNAPSHOT_PC_LO"}, ID_PERF_SNAPSHOT_PC_LO_gfx11, isGFX11},
207 {{"HW_REG_PERF_SNAPSHOT_PC_HI"}, ID_PERF_SNAPSHOT_PC_HI_gfx11, isGFX11},
208
209 // Register numbers reused in GFX12+
210 {{"HW_REG_STATE_PRIV"}, ID_STATE_PRIV, isGFX12Plus},
211 {{"HW_REG_PERF_SNAPSHOT_DATA1"}, ID_PERF_SNAPSHOT_DATA1, isGFX12Plus},
212 {{"HW_REG_PERF_SNAPSHOT_DATA2"}, ID_PERF_SNAPSHOT_DATA2, isGFX12Plus},
213 {{"HW_REG_EXCP_FLAG_PRIV"}, ID_EXCP_FLAG_PRIV, isGFX12Plus},
214 {{"HW_REG_EXCP_FLAG_USER"}, ID_EXCP_FLAG_USER, isGFX12Plus},
215 {{"HW_REG_TRAP_CTRL"}, ID_TRAP_CTRL, isGFX12Plus},
216 {{"HW_REG_SCRATCH_BASE_LO"}, ID_FLAT_SCR_LO, isGFX12Plus},
217 {{"HW_REG_SCRATCH_BASE_HI"}, ID_FLAT_SCR_HI, isGFX12Plus},
218 {{"HW_REG_SHADER_CYCLES_LO"}, ID_SHADER_CYCLES, isGFX12Plus},
219
220 // GFX940 specific registers
221 {{"HW_REG_XCC_ID"}, ID_XCC_ID, isGFX940},
222 {{"HW_REG_SQ_PERF_SNAPSHOT_DATA"}, ID_SQ_PERF_SNAPSHOT_DATA, isGFX940},
223 {{"HW_REG_SQ_PERF_SNAPSHOT_DATA1"}, ID_SQ_PERF_SNAPSHOT_DATA1, isGFX940},
224 {{"HW_REG_SQ_PERF_SNAPSHOT_PC_LO"}, ID_SQ_PERF_SNAPSHOT_PC_LO, isGFX940},
225 {{"HW_REG_SQ_PERF_SNAPSHOT_PC_HI"}, ID_SQ_PERF_SNAPSHOT_PC_HI, isGFX940},
226
227 // Aliases
228 {{"HW_REG_HW_ID"}, ID_HW_ID1, isGFX10},
229};
230// clang-format on
231// NOLINTEND
232
235}
236
238 return getNameFromOperandTable(Operands, Encoding, STI);
239}
240
241} // namespace Hwreg
242
243namespace MTBUFFormat {
244
246 "BUF_DATA_FORMAT_INVALID",
247 "BUF_DATA_FORMAT_8",
248 "BUF_DATA_FORMAT_16",
249 "BUF_DATA_FORMAT_8_8",
250 "BUF_DATA_FORMAT_32",
251 "BUF_DATA_FORMAT_16_16",
252 "BUF_DATA_FORMAT_10_11_11",
253 "BUF_DATA_FORMAT_11_11_10",
254 "BUF_DATA_FORMAT_10_10_10_2",
255 "BUF_DATA_FORMAT_2_10_10_10",
256 "BUF_DATA_FORMAT_8_8_8_8",
257 "BUF_DATA_FORMAT_32_32",
258 "BUF_DATA_FORMAT_16_16_16_16",
259 "BUF_DATA_FORMAT_32_32_32",
260 "BUF_DATA_FORMAT_32_32_32_32",
261 "BUF_DATA_FORMAT_RESERVED_15"
262};
263
265 "BUF_NUM_FORMAT_UNORM",
266 "BUF_NUM_FORMAT_SNORM",
267 "BUF_NUM_FORMAT_USCALED",
268 "BUF_NUM_FORMAT_SSCALED",
269 "BUF_NUM_FORMAT_UINT",
270 "BUF_NUM_FORMAT_SINT",
271 "",
272 "BUF_NUM_FORMAT_FLOAT"
273};
274
276 "BUF_NUM_FORMAT_UNORM",
277 "BUF_NUM_FORMAT_SNORM",
278 "BUF_NUM_FORMAT_USCALED",
279 "BUF_NUM_FORMAT_SSCALED",
280 "BUF_NUM_FORMAT_UINT",
281 "BUF_NUM_FORMAT_SINT",
282 "BUF_NUM_FORMAT_SNORM_OGL",
283 "BUF_NUM_FORMAT_FLOAT"
284};
285
286StringLiteral const NfmtSymbolicVI[] = { // VI and GFX9
287 "BUF_NUM_FORMAT_UNORM",
288 "BUF_NUM_FORMAT_SNORM",
289 "BUF_NUM_FORMAT_USCALED",
290 "BUF_NUM_FORMAT_SSCALED",
291 "BUF_NUM_FORMAT_UINT",
292 "BUF_NUM_FORMAT_SINT",
293 "BUF_NUM_FORMAT_RESERVED_6",
294 "BUF_NUM_FORMAT_FLOAT"
295};
296
298 "BUF_FMT_INVALID",
299
300 "BUF_FMT_8_UNORM",
301 "BUF_FMT_8_SNORM",
302 "BUF_FMT_8_USCALED",
303 "BUF_FMT_8_SSCALED",
304 "BUF_FMT_8_UINT",
305 "BUF_FMT_8_SINT",
306
307 "BUF_FMT_16_UNORM",
308 "BUF_FMT_16_SNORM",
309 "BUF_FMT_16_USCALED",
310 "BUF_FMT_16_SSCALED",
311 "BUF_FMT_16_UINT",
312 "BUF_FMT_16_SINT",
313 "BUF_FMT_16_FLOAT",
314
315 "BUF_FMT_8_8_UNORM",
316 "BUF_FMT_8_8_SNORM",
317 "BUF_FMT_8_8_USCALED",
318 "BUF_FMT_8_8_SSCALED",
319 "BUF_FMT_8_8_UINT",
320 "BUF_FMT_8_8_SINT",
321
322 "BUF_FMT_32_UINT",
323 "BUF_FMT_32_SINT",
324 "BUF_FMT_32_FLOAT",
325
326 "BUF_FMT_16_16_UNORM",
327 "BUF_FMT_16_16_SNORM",
328 "BUF_FMT_16_16_USCALED",
329 "BUF_FMT_16_16_SSCALED",
330 "BUF_FMT_16_16_UINT",
331 "BUF_FMT_16_16_SINT",
332 "BUF_FMT_16_16_FLOAT",
333
334 "BUF_FMT_10_11_11_UNORM",
335 "BUF_FMT_10_11_11_SNORM",
336 "BUF_FMT_10_11_11_USCALED",
337 "BUF_FMT_10_11_11_SSCALED",
338 "BUF_FMT_10_11_11_UINT",
339 "BUF_FMT_10_11_11_SINT",
340 "BUF_FMT_10_11_11_FLOAT",
341
342 "BUF_FMT_11_11_10_UNORM",
343 "BUF_FMT_11_11_10_SNORM",
344 "BUF_FMT_11_11_10_USCALED",
345 "BUF_FMT_11_11_10_SSCALED",
346 "BUF_FMT_11_11_10_UINT",
347 "BUF_FMT_11_11_10_SINT",
348 "BUF_FMT_11_11_10_FLOAT",
349
350 "BUF_FMT_10_10_10_2_UNORM",
351 "BUF_FMT_10_10_10_2_SNORM",
352 "BUF_FMT_10_10_10_2_USCALED",
353 "BUF_FMT_10_10_10_2_SSCALED",
354 "BUF_FMT_10_10_10_2_UINT",
355 "BUF_FMT_10_10_10_2_SINT",
356
357 "BUF_FMT_2_10_10_10_UNORM",
358 "BUF_FMT_2_10_10_10_SNORM",
359 "BUF_FMT_2_10_10_10_USCALED",
360 "BUF_FMT_2_10_10_10_SSCALED",
361 "BUF_FMT_2_10_10_10_UINT",
362 "BUF_FMT_2_10_10_10_SINT",
363
364 "BUF_FMT_8_8_8_8_UNORM",
365 "BUF_FMT_8_8_8_8_SNORM",
366 "BUF_FMT_8_8_8_8_USCALED",
367 "BUF_FMT_8_8_8_8_SSCALED",
368 "BUF_FMT_8_8_8_8_UINT",
369 "BUF_FMT_8_8_8_8_SINT",
370
371 "BUF_FMT_32_32_UINT",
372 "BUF_FMT_32_32_SINT",
373 "BUF_FMT_32_32_FLOAT",
374
375 "BUF_FMT_16_16_16_16_UNORM",
376 "BUF_FMT_16_16_16_16_SNORM",
377 "BUF_FMT_16_16_16_16_USCALED",
378 "BUF_FMT_16_16_16_16_SSCALED",
379 "BUF_FMT_16_16_16_16_UINT",
380 "BUF_FMT_16_16_16_16_SINT",
381 "BUF_FMT_16_16_16_16_FLOAT",
382
383 "BUF_FMT_32_32_32_UINT",
384 "BUF_FMT_32_32_32_SINT",
385 "BUF_FMT_32_32_32_FLOAT",
386 "BUF_FMT_32_32_32_32_UINT",
387 "BUF_FMT_32_32_32_32_SINT",
388 "BUF_FMT_32_32_32_32_FLOAT"
389};
390
391unsigned const DfmtNfmt2UFmtGFX10[] = {
393
400
408
415
419
427
435
443
450
457
464
468
476
483};
484
486 "BUF_FMT_INVALID",
487
488 "BUF_FMT_8_UNORM",
489 "BUF_FMT_8_SNORM",
490 "BUF_FMT_8_USCALED",
491 "BUF_FMT_8_SSCALED",
492 "BUF_FMT_8_UINT",
493 "BUF_FMT_8_SINT",
494
495 "BUF_FMT_16_UNORM",
496 "BUF_FMT_16_SNORM",
497 "BUF_FMT_16_USCALED",
498 "BUF_FMT_16_SSCALED",
499 "BUF_FMT_16_UINT",
500 "BUF_FMT_16_SINT",
501 "BUF_FMT_16_FLOAT",
502
503 "BUF_FMT_8_8_UNORM",
504 "BUF_FMT_8_8_SNORM",
505 "BUF_FMT_8_8_USCALED",
506 "BUF_FMT_8_8_SSCALED",
507 "BUF_FMT_8_8_UINT",
508 "BUF_FMT_8_8_SINT",
509
510 "BUF_FMT_32_UINT",
511 "BUF_FMT_32_SINT",
512 "BUF_FMT_32_FLOAT",
513
514 "BUF_FMT_16_16_UNORM",
515 "BUF_FMT_16_16_SNORM",
516 "BUF_FMT_16_16_USCALED",
517 "BUF_FMT_16_16_SSCALED",
518 "BUF_FMT_16_16_UINT",
519 "BUF_FMT_16_16_SINT",
520 "BUF_FMT_16_16_FLOAT",
521
522 "BUF_FMT_10_11_11_FLOAT",
523
524 "BUF_FMT_11_11_10_FLOAT",
525
526 "BUF_FMT_10_10_10_2_UNORM",
527 "BUF_FMT_10_10_10_2_SNORM",
528 "BUF_FMT_10_10_10_2_UINT",
529 "BUF_FMT_10_10_10_2_SINT",
530
531 "BUF_FMT_2_10_10_10_UNORM",
532 "BUF_FMT_2_10_10_10_SNORM",
533 "BUF_FMT_2_10_10_10_USCALED",
534 "BUF_FMT_2_10_10_10_SSCALED",
535 "BUF_FMT_2_10_10_10_UINT",
536 "BUF_FMT_2_10_10_10_SINT",
537
538 "BUF_FMT_8_8_8_8_UNORM",
539 "BUF_FMT_8_8_8_8_SNORM",
540 "BUF_FMT_8_8_8_8_USCALED",
541 "BUF_FMT_8_8_8_8_SSCALED",
542 "BUF_FMT_8_8_8_8_UINT",
543 "BUF_FMT_8_8_8_8_SINT",
544
545 "BUF_FMT_32_32_UINT",
546 "BUF_FMT_32_32_SINT",
547 "BUF_FMT_32_32_FLOAT",
548
549 "BUF_FMT_16_16_16_16_UNORM",
550 "BUF_FMT_16_16_16_16_SNORM",
551 "BUF_FMT_16_16_16_16_USCALED",
552 "BUF_FMT_16_16_16_16_SSCALED",
553 "BUF_FMT_16_16_16_16_UINT",
554 "BUF_FMT_16_16_16_16_SINT",
555 "BUF_FMT_16_16_16_16_FLOAT",
556
557 "BUF_FMT_32_32_32_UINT",
558 "BUF_FMT_32_32_32_SINT",
559 "BUF_FMT_32_32_32_FLOAT",
560 "BUF_FMT_32_32_32_32_UINT",
561 "BUF_FMT_32_32_32_32_SINT",
562 "BUF_FMT_32_32_32_32_FLOAT"
563};
564
565unsigned const DfmtNfmt2UFmtGFX11[] = {
567
574
582
589
593
601
603
605
610
617
624
628
636
643};
644
645} // namespace MTBUFFormat
646
647namespace Swizzle {
648
649// This must be in sync with llvm::AMDGPU::Swizzle::Id enum members, see SIDefines.h.
650const char* const IdSymbolic[] = {
651 "QUAD_PERM",
652 "BITMASK_PERM",
653 "SWAP",
654 "REVERSE",
655 "BROADCAST",
656};
657
658} // namespace Swizzle
659
660namespace VGPRIndexMode {
661
662// This must be in sync with llvm::AMDGPU::VGPRIndexMode::Id enum members, see SIDefines.h.
663const char* const IdSymbolic[] = {
664 "SRC0",
665 "SRC1",
666 "SRC2",
667 "DST",
668};
669
670} // namespace VGPRIndexMode
671
672} // namespace AMDGPU
673} // namespace llvm
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
std::string Name
static std::vector< std::pair< int, unsigned > > Swizzle(std::vector< std::pair< int, unsigned > > Src, R600InstrInfo::BankSwizzle Swz)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Generic base class for all target subtargets.
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
Definition: StringRef.h:845
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
const CustomOperandVal DepCtrInfo[]
StringRef getHwreg(uint64_t Encoding, const MCSubtargetInfo &STI)
int64_t getHwregId(StringRef Name, const MCSubtargetInfo &STI)
static constexpr CustomOperand Operands[]
StringLiteral const UfmtSymbolicGFX11[]
unsigned const DfmtNfmt2UFmtGFX10[]
StringLiteral const DfmtSymbolic[]
StringLiteral const NfmtSymbolicGFX10[]
unsigned const DfmtNfmt2UFmtGFX11[]
StringLiteral const NfmtSymbolicVI[]
StringLiteral const NfmtSymbolicSICI[]
StringLiteral const UfmtSymbolicGFX10[]
int64_t getMsgOpId(int64_t MsgId, StringRef Name, const MCSubtargetInfo &STI)
Map from a symbolic name for a sendmsg operation to the operation portion of the immediate encoding.
int64_t getMsgId(StringRef Name, const MCSubtargetInfo &STI)
Map from a symbolic name for a msg_id to the message portion of the immediate encoding.
static constexpr CustomOperand SysMsgOperands[]
static constexpr CustomOperand StreamMsgOperands[]
StringRef getMsgName(uint64_t Encoding, const MCSubtargetInfo &STI)
Map from an encoding to the symbolic name for a msg_id immediate.
static constexpr CustomOperand MsgOperands[]
StringRef getMsgOpName(int64_t MsgId, uint64_t Encoding, const MCSubtargetInfo &STI)
Map from an encoding to the symbolic name for a sendmsg operation.
bool msgRequiresOp(int64_t MsgId, const MCSubtargetInfo &STI)
const char *const IdSymbolic[]
const char *const IdSymbolic[]
bool isGFX10_BEncoding(const MCSubtargetInfo &STI)
bool isGFX10_GFX11(const MCSubtargetInfo &STI)
bool isGFX10Before1030(const MCSubtargetInfo &STI)
const int OPR_ID_UNSUPPORTED
bool isGFX10(const MCSubtargetInfo &STI)
static int64_t getEncodingFromOperandTable(const CustomOperand(&Table)[N], StringRef Name, const MCSubtargetInfo &STI)
Map from a symbolic name for a sendmsg/hwreg asm operand to it's encoding.
bool isGFX12Plus(const MCSubtargetInfo &STI)
bool isGFX940(const MCSubtargetInfo &STI)
bool isGFX11(const MCSubtargetInfo &STI)
bool isGFX10_3_GFX11(const MCSubtargetInfo &STI)
bool isGFX8_GFX9_GFX10(const MCSubtargetInfo &STI)
bool isNotGFX10Plus(const MCSubtargetInfo &STI)
static StringRef getNameFromOperandTable(const CustomOperand(&Table)[N], unsigned Encoding, const MCSubtargetInfo &STI)
Map from the encoding of a sendmsg/hwreg asm operand to it's name.
bool isNotGFX11Plus(const MCSubtargetInfo &STI)
bool isGFX11Plus(const MCSubtargetInfo &STI)
bool isGFX10Plus(const MCSubtargetInfo &STI)
bool isNotGFX9Plus(const MCSubtargetInfo &STI)
bool isGFX9Plus(const MCSubtargetInfo &STI)
const int OPR_ID_UNKNOWN
bool isNotGFX12Plus(const MCSubtargetInfo &STI)
bool isGFX9_GFX10_GFX11(const MCSubtargetInfo &STI)
bool isGFX9_GFX10(const MCSubtargetInfo &STI)
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
#define N