LLVM 22.0.0git
SIDefines.h
Go to the documentation of this file.
1//===-- SIDefines.h - SI Helper Macros ----------------------*- C++ -*-===//
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/// \file
8//===----------------------------------------------------------------------===//
9
10#ifndef LLVM_LIB_TARGET_AMDGPU_SIDEFINES_H
11#define LLVM_LIB_TARGET_AMDGPU_SIDEFINES_H
12
13#include "llvm/MC/MCInstrDesc.h"
14
15namespace llvm {
16
17// This needs to be kept in sync with the field bits in SIRegisterClass.
31
33// This must be kept in sync with the SIEncodingFamily class in SIInstrInfo.td
34// and the columns of the getMCOpcodeGen table.
35enum {
36 SI = 0,
37 VI = 1,
38 SDWA = 2,
39 SDWA9 = 3,
40 GFX80 = 4,
41 GFX9 = 5,
42 GFX10 = 6,
43 SDWA10 = 7,
44 GFX90A = 8,
45 GFX940 = 9,
46 GFX11 = 10,
47 GFX12 = 11,
48 GFX1250 = 12,
49};
50}
51
52namespace SIInstrFlags {
53// This needs to be kept in sync with the field bits in InstSI.
54enum : uint64_t {
55 // Low bits - basic encoding information.
56 SALU = 1 << 0,
57 VALU = 1 << 1,
58
59 // SALU instruction formats.
60 SOP1 = 1 << 2,
61 SOP2 = 1 << 3,
62 SOPC = 1 << 4,
63 SOPK = 1 << 5,
64 SOPP = 1 << 6,
65
66 // VALU instruction formats.
67 VOP1 = 1 << 7,
68 VOP2 = 1 << 8,
69 VOPC = 1 << 9,
70
71 // TODO: Should this be spilt into VOP3 a and b?
72 VOP3 = 1 << 10,
73 VOP3P = 1 << 12,
74
75 VINTRP = 1 << 13,
76 SDWA = 1 << 14,
77 DPP = 1 << 15,
78 TRANS = 1 << 16,
79
80 // Memory instruction formats.
81 MUBUF = 1 << 17,
82 MTBUF = 1 << 18,
83 SMRD = 1 << 19,
84 MIMG = 1 << 20,
85 VIMAGE = 1 << 21,
86 VSAMPLE = 1 << 22,
87 EXP = 1 << 23,
88 FLAT = 1 << 24,
89 DS = 1 << 25,
90
91 // Combined SGPR/VGPR Spill bit
92 // Logic to separate them out is done in isSGPRSpill and isVGPRSpill
93 Spill = 1 << 26,
94
95 // LDSDIR instruction format.
96 LDSDIR = 1 << 28,
97
98 // VINTERP instruction format.
99 VINTERP = 1 << 29,
100
101 VOPD3 = 1 << 30,
102
103 // High bits - other information.
104 VM_CNT = UINT64_C(1) << 32,
105 EXP_CNT = UINT64_C(1) << 33,
106 LGKM_CNT = UINT64_C(1) << 34,
107
108 WQM = UINT64_C(1) << 35,
109 DisableWQM = UINT64_C(1) << 36,
110 Gather4 = UINT64_C(1) << 37,
111
112 TENSOR_CNT = UINT64_C(1) << 38,
113
114 SCALAR_STORE = UINT64_C(1) << 39,
115 FIXED_SIZE = UINT64_C(1) << 40,
116
117 ASYNC_CNT = UINT64_C(1) << 41,
118
119 VOP3_OPSEL = UINT64_C(1) << 42,
120 maybeAtomic = UINT64_C(1) << 43,
121 renamedInGFX9 = UINT64_C(1) << 44,
122
123 // Is a clamp on FP type.
124 FPClamp = UINT64_C(1) << 45,
125
126 // Is an integer clamp
127 IntClamp = UINT64_C(1) << 46,
128
129 // Clamps lo component of register.
130 ClampLo = UINT64_C(1) << 47,
131
132 // Clamps hi component of register.
133 // ClampLo and ClampHi set for packed clamp.
134 ClampHi = UINT64_C(1) << 48,
135
136 // Is a packed VOP3P instruction.
137 IsPacked = UINT64_C(1) << 49,
138
139 // Is a D16 buffer instruction.
140 D16Buf = UINT64_C(1) << 50,
141
142 // FLAT instruction accesses FLAT_GLBL segment.
143 FlatGlobal = UINT64_C(1) << 51,
144
145 // Uses floating point double precision rounding mode
146 FPDPRounding = UINT64_C(1) << 52,
147
148 // Instruction is FP atomic.
149 FPAtomic = UINT64_C(1) << 53,
150
151 // Is a MFMA instruction.
152 IsMAI = UINT64_C(1) << 54,
153
154 // Is a DOT instruction.
155 IsDOT = UINT64_C(1) << 55,
156
157 // FLAT instruction accesses FLAT_SCRATCH segment.
158 FlatScratch = UINT64_C(1) << 56,
159
160 // Atomic without return.
161 IsAtomicNoRet = UINT64_C(1) << 57,
162
163 // Atomic with return.
164 IsAtomicRet = UINT64_C(1) << 58,
165
166 // Is a WMMA instruction.
167 IsWMMA = UINT64_C(1) << 59,
168
169 // Whether tied sources will be read.
170 TiedSourceNotRead = UINT64_C(1) << 60,
171
172 // Is never uniform.
173 IsNeverUniform = UINT64_C(1) << 61,
174
175 // ds_gws_* instructions.
176 GWS = UINT64_C(1) << 62,
177
178 // Is a SWMMAC instruction.
179 IsSWMMAC = UINT64_C(1) << 63,
180};
181
182// v_cmp_class_* etc. use a 10-bit mask for what operation is checked.
183// The result is true if any of these tests are true.
184enum ClassFlags : unsigned {
185 S_NAN = 1 << 0, // Signaling NaN
186 Q_NAN = 1 << 1, // Quiet NaN
187 N_INFINITY = 1 << 2, // Negative infinity
188 N_NORMAL = 1 << 3, // Negative normal
189 N_SUBNORMAL = 1 << 4, // Negative subnormal
190 N_ZERO = 1 << 5, // Negative zero
191 P_ZERO = 1 << 6, // Positive zero
192 P_SUBNORMAL = 1 << 7, // Positive subnormal
193 P_NORMAL = 1 << 8, // Positive normal
194 P_INFINITY = 1 << 9 // Positive infinity
195};
196}
197
198namespace AMDGPU {
199enum OperandType : unsigned {
200 /// Operands with register, 32-bit, or 64-bit immediate
214
215 /// Operands with register or inline constant
226
227 // Operand for split barrier inline constant
229
230 /// Operand with 32-bit immediate that uses the constant bus.
234
235 /// Operands with an AccVGPR register or inline constant
239
240 // Operand for AV_MOV_B64_IMM_PSEUDO, which is a pair of 32-bit inline
241 // constants. Does not accept registers.
243
244 // Operand for source modifiers for VOP instructions
246
247 // Operand for SDWA instructions
249
252
255
258
261
264
265};
266}
267
268// Input operand modifiers bit-masks
269// NEG and SEXT share same bit-mask because they can't be set simultaneously.
270namespace SISrcMods {
271enum : unsigned {
272 NONE = 0,
273 NEG = 1 << 0, // Floating-point negate modifier
274 ABS = 1 << 1, // Floating-point absolute modifier
275 SEXT = 1 << 4, // Integer sign-extend modifier
276 NEG_HI = ABS, // Floating-point negate high packed component modifier.
277 OP_SEL_0 = 1 << 2,
278 OP_SEL_1 = 1 << 3,
279 DST_OP_SEL = 1 << 3 // VOP3 dst op_sel (share mask with OP_SEL_1)
280};
281}
282
283namespace SIOutMods {
284 enum : unsigned {
285 NONE = 0,
286 MUL2 = 1,
287 MUL4 = 2,
289 };
290}
291
292namespace AMDGPU {
293namespace VGPRIndexMode {
294
295enum Id : unsigned { // id of symbolic names
300
303};
304
314
315} // namespace VGPRIndexMode
316} // namespace AMDGPU
317
319 enum : unsigned {
321 VOP3 = 1,
322 SDWA = 2,
323 SDWA9 = 3,
324 DPP = 4,
326 };
327} // namespace AMDGPUAsmVariants
328
329namespace AMDGPU {
330namespace EncValues { // Encoding values of enum9/8/7 operands
331
332enum : unsigned {
347 VGPR_MIN = 256,
348 VGPR_MAX = 511,
349 IS_VGPR = 256, // Indicates VGPR or AGPR
350};
351
352} // namespace EncValues
353
354// Register codes as defined in the TableGen's HWEncoding field.
355namespace HWEncoding {
356enum : unsigned {
359 IS_VGPR = 1 << 10,
360 IS_AGPR = 1 << 11,
361 IS_HI16 = 1 << 12,
362};
363} // namespace HWEncoding
364
365namespace CPol {
366
367enum CPol {
368 GLC = 1,
369 SLC = 2,
370 DLC = 4,
371 SCC = 16,
377
378 // Below are GFX12+ cache policy bits
379
380 // Temporal hint
381 TH = 0x7, // All TH bits
382 TH_RT = 0, // regular
383 TH_NT = 1, // non-temporal
384 TH_HT = 2, // high-temporal
385 TH_LU = 3, // last use
386 TH_WB = 3, // regular (CU, SE), high-temporal with write-back (MALL)
387 TH_NT_RT = 4, // non-temporal (CU, SE), regular (MALL)
388 TH_RT_NT = 5, // regular (CU, SE), non-temporal (MALL)
389 TH_NT_HT = 6, // non-temporal (CU, SE), high-temporal (MALL)
390 TH_NT_WB = 7, // non-temporal (CU, SE), high-temporal with write-back (MALL)
391 TH_BYPASS = 3, // only to be used with scope = 3
392
393 TH_RESERVED = 7, // unused value for load insts
394
395 // Bits of TH for atomics
396 TH_ATOMIC_RETURN = GLC, // Returning vs non-returning
397 TH_ATOMIC_NT = SLC, // Non-temporal vs regular
398 TH_ATOMIC_CASCADE = 4, // Cascading vs regular
399
400 // Scope
403 SCOPE = SCOPE_MASK << SCOPE_SHIFT, // All Scope bits
408
409 NV = 1 << 5, // Non-volatile bit
410
411 SWZ = 1 << 6, // Swizzle bit
412
413 SCAL = 1 << 11, // Scale offset bit
414
415 ALL = TH | SCOPE | NV,
416
417 // Helper bits
418 TH_TYPE_LOAD = 1 << 7, // TH_LOAD policy
419 TH_TYPE_STORE = 1 << 8, // TH_STORE policy
420 TH_TYPE_ATOMIC = 1 << 9, // TH_ATOMIC policy
421 TH_REAL_BYPASS = 1 << 10, // is TH=3 bypass policy or not
422
423 // Volatile (used to preserve/signal operation volatility for buffer
424 // operations not a real instruction bit)
425 VOLATILE = 1 << 31,
426 // The set of "cache policy" bits used for compiler features that
427 // do not correspond to handware features.
429};
430
431} // namespace CPol
432
433namespace SendMsg { // Encoding of SIMM16 used in s_sendmsg* insns.
434
435enum Id { // Message ID, width(4) [3:0].
437
438 ID_GS_PreGFX11 = 2, // replaced in GFX11
439 ID_GS_DONE_PreGFX11 = 3, // replaced in GFX11
440
441 ID_HS_TESSFACTOR_GFX11Plus = 2, // reused in GFX11
442 ID_DEALLOC_VGPRS_GFX11Plus = 3, // reused in GFX11
443
444 ID_SAVEWAVE = 4, // added in GFX8, removed in GFX11
445 ID_STALL_WAVE_GEN = 5, // added in GFX9, removed in GFX12
446 ID_HALT_WAVES = 6, // added in GFX9, removed in GFX12
447 ID_ORDERED_PS_DONE = 7, // added in GFX9, removed in GFX11
448 ID_EARLY_PRIM_DEALLOC = 8, // added in GFX9, removed in GFX10
449 ID_GS_ALLOC_REQ = 9, // added in GFX9
450 ID_GET_DOORBELL = 10, // added in GFX9, removed in GFX11
451 ID_SAVEWAVE_HAS_TDM = 10, // added in GFX1250
452 ID_GET_DDID = 11, // added in GFX10, removed in GFX11
454
463
464 ID_RTN_GET_CLUSTER_BARRIER_STATE = 136, // added in GFX1250
465
468};
469
470enum Op { // Both GS and SYS operation IDs.
473 // Bits used for operation encoding
475 OP_MASK_ = (((1 << OP_WIDTH_) - 1) << OP_SHIFT_),
476 // GS operations are encoded in bits 5:4
482 // SYS operations are encoded in bits 6:4
488};
489
499
500} // namespace SendMsg
501
502namespace Hwreg { // Encoding of SIMM16 used in s_setreg/getreg* insns.
503
557
558enum Offset : unsigned { // Offset, (5) [10:6]
560 OFFSET_ME_ID = 8, // in HW_ID2
561};
562
564 FP_ROUND_MASK = 0xf << 0, // Bits 0..3
565 FP_DENORM_MASK = 0xf << 4, // Bits 4..7
568 LOD_CLAMP_MASK = 1 << 10,
569 DEBUG_MASK = 1 << 11,
570
571 // EXCP_EN fields.
579
581 VSKIP_MASK = 1 << 28,
582 CSP_MASK = 0x7u << 29, // Bits 29..31
583
584 // GFX1250
585 DST_VGPR_MSB = 1 << 12,
586 SRC0_VGPR_MSB = 1 << 13,
587 SRC1_VGPR_MSB = 1 << 14,
588 SRC2_VGPR_MSB = 1 << 15,
589 VGPR_MSB_MASK = 0xf << 12, // Bits 12..15
590
591 REPLAY_MODE = 1 << 25,
593};
594
595} // namespace Hwreg
596
666
667namespace UfmtGFX10 {
668enum UnifiedFormat : int64_t {
670
677
685
692
696
704
712
720
727
734
741
745
753
760
763};
764
765} // namespace UfmtGFX10
766
767namespace UfmtGFX11 {
768enum UnifiedFormat : int64_t {
770
777
785
792
796
804
806
808
813
820
827
831
839
846
849};
850
851} // namespace UfmtGFX11
852
853namespace Swizzle { // Encoding of swizzle macro used in ds_swizzle_b32.
854
864
865// clang-format off
866enum EncBits : unsigned {
867
868 // swizzle mode encodings
869
872
875
876 FFT_MODE_ENC = 0xE000,
877
880
882 FFT_MODE_LO = 0xE000,
883
884 // QUAD_PERM encodings
885
890
891 // BITMASK_PERM encodings
892
896
900
901 // FFT encodings
902
905
906 // ROTATE encodings
908 ROTATE_DIR_SHIFT = 10, // bit position of rotate direction
910 ROTATE_SIZE_SHIFT = 5, // bit position of rotate size
912};
913// clang-format on
914
915} // namespace Swizzle
916
917namespace SDWA {
918
919enum SdwaSel : unsigned {
926 DWORD = 6,
927};
928
929enum DstUnused : unsigned {
933};
934
949
950} // namespace SDWA
951
952namespace DPP {
953
954// clang-format off
999// clang-format on
1000
1007
1008} // namespace DPP
1009
1010namespace Exp {
1011
1012enum Target : unsigned {
1016 ET_NULL = 9, // Pre-GFX11
1019 ET_POS4 = 16, // GFX10+
1020 ET_POS_LAST = ET_POS4, // Highest pos used on any subtarget
1021 ET_PRIM = 20, // GFX10+
1022 ET_DUAL_SRC_BLEND0 = 21, // GFX11+
1023 ET_DUAL_SRC_BLEND1 = 22, // GFX11+
1024 ET_PARAM0 = 32, // Pre-GFX11
1025 ET_PARAM31 = 63, // Pre-GFX11
1026
1034
1036};
1037
1038} // namespace Exp
1039
1060
1061namespace VOP3PEncoding {
1062
1064 OP_SEL_HI_0 = UINT64_C(1) << 59,
1065 OP_SEL_HI_1 = UINT64_C(1) << 60,
1066 OP_SEL_HI_2 = UINT64_C(1) << 14,
1067};
1068
1069} // namespace VOP3PEncoding
1070
1071namespace ImplicitArg {
1072// Implicit kernel argument offset for code object version 5.
1085
1086} // namespace ImplicitArg
1087
1089// Enum value used in cbsz/blgp for F8F6F4 MFMA operations to select the matrix
1090// format.
1098} // namespace MFMAScaleFormats
1099
1100namespace VirtRegFlag {
1101// Virtual register flags used for various target specific handlings during
1102// codegen.
1104 // Register operand in a whole-wave mode operation.
1105 WWM_REG = 1 << 0,
1106};
1107
1108} // namespace VirtRegFlag
1109
1110} // namespace AMDGPU
1111
1112namespace AMDGPU {
1113namespace Barrier {
1114
1123
1124enum {
1126};
1127
1128} // namespace Barrier
1129} // namespace AMDGPU
1130
1131// clang-format off
1132
1133#define R_00B028_SPI_SHADER_PGM_RSRC1_PS 0x00B028
1134#define S_00B028_VGPRS(x) (((x) & 0x3F) << 0)
1135#define S_00B028_SGPRS(x) (((x) & 0x0F) << 6)
1136#define S_00B028_MEM_ORDERED(x) (((x) & 0x1) << 25)
1137#define G_00B028_MEM_ORDERED(x) (((x) >> 25) & 0x1)
1138#define C_00B028_MEM_ORDERED 0xFDFFFFFF
1139
1140#define R_00B02C_SPI_SHADER_PGM_RSRC2_PS 0x00B02C
1141#define S_00B02C_EXTRA_LDS_SIZE(x) (((x) & 0xFF) << 8)
1142#define R_00B128_SPI_SHADER_PGM_RSRC1_VS 0x00B128
1143#define S_00B128_MEM_ORDERED(x) (((x) & 0x1) << 27)
1144#define G_00B128_MEM_ORDERED(x) (((x) >> 27) & 0x1)
1145#define C_00B128_MEM_ORDERED 0xF7FFFFFF
1146
1147#define R_00B228_SPI_SHADER_PGM_RSRC1_GS 0x00B228
1148#define S_00B228_WGP_MODE(x) (((x) & 0x1) << 27)
1149#define G_00B228_WGP_MODE(x) (((x) >> 27) & 0x1)
1150#define C_00B228_WGP_MODE 0xF7FFFFFF
1151#define S_00B228_MEM_ORDERED(x) (((x) & 0x1) << 25)
1152#define G_00B228_MEM_ORDERED(x) (((x) >> 25) & 0x1)
1153#define C_00B228_MEM_ORDERED 0xFDFFFFFF
1154
1155#define R_00B328_SPI_SHADER_PGM_RSRC1_ES 0x00B328
1156#define R_00B428_SPI_SHADER_PGM_RSRC1_HS 0x00B428
1157#define S_00B428_WGP_MODE(x) (((x) & 0x1) << 26)
1158#define G_00B428_WGP_MODE(x) (((x) >> 26) & 0x1)
1159#define C_00B428_WGP_MODE 0xFBFFFFFF
1160#define S_00B428_MEM_ORDERED(x) (((x) & 0x1) << 24)
1161#define G_00B428_MEM_ORDERED(x) (((x) >> 24) & 0x1)
1162#define C_00B428_MEM_ORDERED 0xFEFFFFFF
1163
1164#define R_00B528_SPI_SHADER_PGM_RSRC1_LS 0x00B528
1165
1166#define R_00B84C_COMPUTE_PGM_RSRC2 0x00B84C
1167#define S_00B84C_SCRATCH_EN(x) (((x) & 0x1) << 0)
1168#define G_00B84C_SCRATCH_EN(x) (((x) >> 0) & 0x1)
1169#define C_00B84C_SCRATCH_EN 0xFFFFFFFE
1170#define S_00B84C_USER_SGPR(x) (((x) & 0x1F) << 1)
1171#define G_00B84C_USER_SGPR(x) (((x) >> 1) & 0x1F)
1172#define C_00B84C_USER_SGPR 0xFFFFFFC1
1173#define S_00B84C_TRAP_HANDLER(x) (((x) & 0x1) << 6)
1174#define G_00B84C_TRAP_HANDLER(x) (((x) >> 6) & 0x1)
1175#define C_00B84C_TRAP_HANDLER 0xFFFFFFBF
1176#define S_00B84C_TGID_X_EN(x) (((x) & 0x1) << 7)
1177#define G_00B84C_TGID_X_EN(x) (((x) >> 7) & 0x1)
1178#define C_00B84C_TGID_X_EN 0xFFFFFF7F
1179#define S_00B84C_TGID_Y_EN(x) (((x) & 0x1) << 8)
1180#define G_00B84C_TGID_Y_EN(x) (((x) >> 8) & 0x1)
1181#define C_00B84C_TGID_Y_EN 0xFFFFFEFF
1182#define S_00B84C_TGID_Z_EN(x) (((x) & 0x1) << 9)
1183#define G_00B84C_TGID_Z_EN(x) (((x) >> 9) & 0x1)
1184#define C_00B84C_TGID_Z_EN 0xFFFFFDFF
1185#define S_00B84C_TG_SIZE_EN(x) (((x) & 0x1) << 10)
1186#define G_00B84C_TG_SIZE_EN(x) (((x) >> 10) & 0x1)
1187#define C_00B84C_TG_SIZE_EN 0xFFFFFBFF
1188#define S_00B84C_TIDIG_COMP_CNT(x) (((x) & 0x03) << 11)
1189#define G_00B84C_TIDIG_COMP_CNT(x) (((x) >> 11) & 0x03)
1190#define C_00B84C_TIDIG_COMP_CNT 0xFFFFE7FF
1191/* CIK */
1192#define S_00B84C_EXCP_EN_MSB(x) (((x) & 0x03) << 13)
1193#define G_00B84C_EXCP_EN_MSB(x) (((x) >> 13) & 0x03)
1194#define C_00B84C_EXCP_EN_MSB 0xFFFF9FFF
1195/* */
1196#define S_00B84C_LDS_SIZE(x) (((x) & 0x1FF) << 15)
1197#define G_00B84C_LDS_SIZE(x) (((x) >> 15) & 0x1FF)
1198#define C_00B84C_LDS_SIZE 0xFF007FFF
1199#define S_00B84C_EXCP_EN(x) (((x) & 0x7F) << 24)
1200#define G_00B84C_EXCP_EN(x) (((x) >> 24) & 0x7F)
1201#define C_00B84C_EXCP_EN 0x80FFFFFF
1202
1203#define R_0286CC_SPI_PS_INPUT_ENA 0x0286CC
1204#define R_0286D0_SPI_PS_INPUT_ADDR 0x0286D0
1205
1206#define R_00B848_COMPUTE_PGM_RSRC1 0x00B848
1207#define S_00B848_VGPRS(x) (((x) & 0x3F) << 0)
1208#define G_00B848_VGPRS(x) (((x) >> 0) & 0x3F)
1209#define C_00B848_VGPRS 0xFFFFFFC0
1210#define S_00B848_SGPRS(x) (((x) & 0x0F) << 6)
1211#define G_00B848_SGPRS(x) (((x) >> 6) & 0x0F)
1212#define C_00B848_SGPRS 0xFFFFFC3F
1213#define S_00B848_PRIORITY(x) (((x) & 0x03) << 10)
1214#define G_00B848_PRIORITY(x) (((x) >> 10) & 0x03)
1215#define C_00B848_PRIORITY 0xFFFFF3FF
1216#define S_00B848_FLOAT_MODE(x) (((x) & 0xFF) << 12)
1217#define G_00B848_FLOAT_MODE(x) (((x) >> 12) & 0xFF)
1218#define C_00B848_FLOAT_MODE 0xFFF00FFF
1219#define S_00B848_PRIV(x) (((x) & 0x1) << 20)
1220#define G_00B848_PRIV(x) (((x) >> 20) & 0x1)
1221#define C_00B848_PRIV 0xFFEFFFFF
1222#define S_00B848_DX10_CLAMP(x) (((x) & 0x1) << 21)
1223#define G_00B848_DX10_CLAMP(x) (((x) >> 21) & 0x1)
1224#define C_00B848_DX10_CLAMP 0xFFDFFFFF
1225#define S_00B848_RR_WG_MODE(x) (((x) & 0x1) << 21)
1226#define G_00B848_RR_WG_MODE(x) (((x) >> 21) & 0x1)
1227#define C_00B848_RR_WG_MODE 0xFFDFFFFF
1228#define S_00B848_DEBUG_MODE(x) (((x) & 0x1) << 22)
1229#define G_00B848_DEBUG_MODE(x) (((x) >> 22) & 0x1)
1230#define C_00B848_DEBUG_MODE 0xFFBFFFFF
1231#define S_00B848_IEEE_MODE(x) (((x) & 0x1) << 23)
1232#define G_00B848_IEEE_MODE(x) (((x) >> 23) & 0x1)
1233#define C_00B848_IEEE_MODE 0xFF7FFFFF
1234#define S_00B848_WGP_MODE(x) (((x) & 0x1) << 29)
1235#define G_00B848_WGP_MODE(x) (((x) >> 29) & 0x1)
1236#define C_00B848_WGP_MODE 0xDFFFFFFF
1237#define S_00B848_MEM_ORDERED(x) (((x) & 0x1) << 30)
1238#define G_00B848_MEM_ORDERED(x) (((x) >> 30) & 0x1)
1239#define C_00B848_MEM_ORDERED 0xBFFFFFFF
1240#define S_00B848_FWD_PROGRESS(x) (((x) & 0x1) << 31)
1241#define G_00B848_FWD_PROGRESS(x) (((x) >> 31) & 0x1)
1242#define C_00B848_FWD_PROGRESS 0x7FFFFFFF
1243
1244// Helpers for setting FLOAT_MODE
1245#define FP_ROUND_ROUND_TO_NEAREST 0
1246#define FP_ROUND_ROUND_TO_INF 1
1247#define FP_ROUND_ROUND_TO_NEGINF 2
1248#define FP_ROUND_ROUND_TO_ZERO 3
1249
1250// Bits 3:0 control rounding mode. 1:0 control single precision, 3:2 double
1251// precision.
1252#define FP_ROUND_MODE_SP(x) ((x) & 0x3)
1253#define FP_ROUND_MODE_DP(x) (((x) & 0x3) << 2)
1254
1255#define FP_DENORM_FLUSH_IN_FLUSH_OUT 0
1256#define FP_DENORM_FLUSH_OUT 1
1257#define FP_DENORM_FLUSH_IN 2
1258#define FP_DENORM_FLUSH_NONE 3
1259
1260
1261// Bits 7:4 control denormal handling. 5:4 control single precision, 6:7 double
1262// precision.
1263#define FP_DENORM_MODE_SP(x) (((x) & 0x3) << 4)
1264#define FP_DENORM_MODE_DP(x) (((x) & 0x3) << 6)
1265
1266#define R_00B860_COMPUTE_TMPRING_SIZE 0x00B860
1267#define S_00B860_WAVESIZE_PreGFX11(x) (((x) & 0x1FFF) << 12)
1268#define S_00B860_WAVESIZE_GFX11(x) (((x) & 0x7FFF) << 12)
1269#define S_00B860_WAVESIZE_GFX12Plus(x) (((x) & 0x3FFFF) << 12)
1270
1271#define R_0286E8_SPI_TMPRING_SIZE 0x0286E8
1272#define S_0286E8_WAVESIZE_PreGFX11(x) (((x) & 0x1FFF) << 12)
1273#define S_0286E8_WAVESIZE_GFX11(x) (((x) & 0x7FFF) << 12)
1274#define S_0286E8_WAVESIZE_GFX12Plus(x) (((x) & 0x3FFFF) << 12)
1275
1276#define R_028B54_VGT_SHADER_STAGES_EN 0x028B54
1277#define S_028B54_HS_W32_EN(x) (((x) & 0x1) << 21)
1278#define S_028B54_GS_W32_EN(x) (((x) & 0x1) << 22)
1279#define S_028B54_VS_W32_EN(x) (((x) & 0x1) << 23)
1280#define R_0286D8_SPI_PS_IN_CONTROL 0x0286D8
1281#define S_0286D8_PS_W32_EN(x) (((x) & 0x1) << 15)
1282#define R_00B800_COMPUTE_DISPATCH_INITIATOR 0x00B800
1283#define S_00B800_CS_W32_EN(x) (((x) & 0x1) << 15)
1284
1285#define R_SPILLED_SGPRS 0x4
1286#define R_SPILLED_VGPRS 0x8
1287
1288// clang-format on
1289
1290} // End namespace llvm
1291
1292#endif
@ OPERAND_KIMM32
Operand with 32-bit immediate that uses the constant bus.
Definition SIDefines.h:231
@ OPERAND_REG_INLINE_C_LAST
Definition SIDefines.h:254
@ OPERAND_REG_IMM_INT64
Definition SIDefines.h:202
@ OPERAND_REG_IMM_V2FP16
Definition SIDefines.h:209
@ OPERAND_REG_INLINE_C_FP64
Definition SIDefines.h:222
@ OPERAND_REG_INLINE_C_BF16
Definition SIDefines.h:219
@ OPERAND_REG_IMM_FIRST
Definition SIDefines.h:250
@ OPERAND_REG_INLINE_C_V2BF16
Definition SIDefines.h:224
@ OPERAND_REG_IMM_V2INT16
Definition SIDefines.h:210
@ OPERAND_REG_IMM_BF16
Definition SIDefines.h:206
@ OPERAND_REG_IMM_INT32
Operands with register, 32-bit, or 64-bit immediate.
Definition SIDefines.h:201
@ OPERAND_REG_IMM_V2BF16
Definition SIDefines.h:208
@ OPERAND_REG_INLINE_AC_FIRST
Definition SIDefines.h:256
@ OPERAND_REG_IMM_FP16
Definition SIDefines.h:207
@ OPERAND_REG_INLINE_C_INT64
Definition SIDefines.h:218
@ OPERAND_REG_INLINE_C_INT16
Operands with register or inline constant.
Definition SIDefines.h:216
@ OPERAND_REG_IMM_NOINLINE_V2FP16
Definition SIDefines.h:211
@ OPERAND_REG_IMM_FP64
Definition SIDefines.h:205
@ OPERAND_REG_INLINE_C_V2FP16
Definition SIDefines.h:225
@ OPERAND_REG_INLINE_AC_INT32
Operands with an AccVGPR register or inline constant.
Definition SIDefines.h:236
@ OPERAND_REG_INLINE_AC_FP32
Definition SIDefines.h:237
@ OPERAND_REG_IMM_V2INT32
Definition SIDefines.h:212
@ OPERAND_SDWA_VOPC_DST
Definition SIDefines.h:248
@ OPERAND_REG_IMM_FP32
Definition SIDefines.h:204
@ OPERAND_REG_INLINE_C_FIRST
Definition SIDefines.h:253
@ OPERAND_REG_INLINE_C_FP32
Definition SIDefines.h:221
@ OPERAND_REG_INLINE_AC_LAST
Definition SIDefines.h:257
@ OPERAND_REG_IMM_LAST
Definition SIDefines.h:251
@ OPERAND_REG_INLINE_C_INT32
Definition SIDefines.h:217
@ OPERAND_REG_INLINE_C_V2INT16
Definition SIDefines.h:223
@ OPERAND_INLINE_C_AV64_PSEUDO
Definition SIDefines.h:242
@ OPERAND_REG_IMM_V2FP32
Definition SIDefines.h:213
@ OPERAND_REG_INLINE_AC_FP64
Definition SIDefines.h:238
@ OPERAND_REG_INLINE_C_FP16
Definition SIDefines.h:220
@ OPERAND_REG_IMM_INT16
Definition SIDefines.h:203
@ OPERAND_INLINE_SPLIT_BARRIER_INT32
Definition SIDefines.h:228
@ OPERAND_FIRST_TARGET
Definition MCInstrDesc.h:79
This is an optimization pass for GlobalISel generic memory operations.
SIRCFlags
Definition SIDefines.h:18
@ HasSGPR
Definition SIDefines.h:26
@ HasAGPRBit
Definition SIDefines.h:21
@ HasSGPRbit
Definition SIDefines.h:22
@ RegTupleAlignUnitsWidth
Definition SIDefines.h:19
@ RegTupleAlignUnitsMask
Definition SIDefines.h:28
@ HasVGPRBit
Definition SIDefines.h:20
@ HasVGPR
Definition SIDefines.h:24
@ RegKindMask
Definition SIDefines.h:29
@ HasAGPR
Definition SIDefines.h:25