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};
427
428} // namespace CPol
429
430namespace SendMsg { // Encoding of SIMM16 used in s_sendmsg* insns.
431
432enum Id { // Message ID, width(4) [3:0].
434
435 ID_GS_PreGFX11 = 2, // replaced in GFX11
436 ID_GS_DONE_PreGFX11 = 3, // replaced in GFX11
437
438 ID_HS_TESSFACTOR_GFX11Plus = 2, // reused in GFX11
439 ID_DEALLOC_VGPRS_GFX11Plus = 3, // reused in GFX11
440
441 ID_SAVEWAVE = 4, // added in GFX8, removed in GFX11
442 ID_STALL_WAVE_GEN = 5, // added in GFX9, removed in GFX12
443 ID_HALT_WAVES = 6, // added in GFX9, removed in GFX12
444 ID_ORDERED_PS_DONE = 7, // added in GFX9, removed in GFX11
445 ID_EARLY_PRIM_DEALLOC = 8, // added in GFX9, removed in GFX10
446 ID_GS_ALLOC_REQ = 9, // added in GFX9
447 ID_GET_DOORBELL = 10, // added in GFX9, removed in GFX11
448 ID_SAVEWAVE_HAS_TDM = 10, // added in GFX1250
449 ID_GET_DDID = 11, // added in GFX10, removed in GFX11
451
460
461 ID_RTN_GET_CLUSTER_BARRIER_STATE = 136, // added in GFX1250
462
465};
466
467enum Op { // Both GS and SYS operation IDs.
470 // Bits used for operation encoding
472 OP_MASK_ = (((1 << OP_WIDTH_) - 1) << OP_SHIFT_),
473 // GS operations are encoded in bits 5:4
479 // SYS operations are encoded in bits 6:4
485};
486
496
497} // namespace SendMsg
498
499namespace Hwreg { // Encoding of SIMM16 used in s_setreg/getreg* insns.
500
553
554enum Offset : unsigned { // Offset, (5) [10:6]
556 OFFSET_ME_ID = 8, // in HW_ID2
557};
558
560 FP_ROUND_MASK = 0xf << 0, // Bits 0..3
561 FP_DENORM_MASK = 0xf << 4, // Bits 4..7
564 LOD_CLAMP_MASK = 1 << 10,
565 DEBUG_MASK = 1 << 11,
566
567 // EXCP_EN fields.
575
577 VSKIP_MASK = 1 << 28,
578 CSP_MASK = 0x7u << 29, // Bits 29..31
579
580 // GFX1250
581 DST_VGPR_MSB = 1 << 12,
582 SRC0_VGPR_MSB = 1 << 13,
583 SRC1_VGPR_MSB = 1 << 14,
584 SRC2_VGPR_MSB = 1 << 15,
585 VGPR_MSB_MASK = 0xf << 12, // Bits 12..15
586
587 REPLAY_MODE = 1 << 25,
589};
590
591} // namespace Hwreg
592
662
663namespace UfmtGFX10 {
664enum UnifiedFormat : int64_t {
666
673
681
688
692
700
708
716
723
730
737
741
749
756
759};
760
761} // namespace UfmtGFX10
762
763namespace UfmtGFX11 {
764enum UnifiedFormat : int64_t {
766
773
781
788
792
800
802
804
809
816
823
827
835
842
845};
846
847} // namespace UfmtGFX11
848
849namespace Swizzle { // Encoding of swizzle macro used in ds_swizzle_b32.
850
860
861// clang-format off
862enum EncBits : unsigned {
863
864 // swizzle mode encodings
865
868
871
872 FFT_MODE_ENC = 0xE000,
873
876
878 FFT_MODE_LO = 0xE000,
879
880 // QUAD_PERM encodings
881
886
887 // BITMASK_PERM encodings
888
892
896
897 // FFT encodings
898
901
902 // ROTATE encodings
904 ROTATE_DIR_SHIFT = 10, // bit position of rotate direction
906 ROTATE_SIZE_SHIFT = 5, // bit position of rotate size
908};
909// clang-format on
910
911} // namespace Swizzle
912
913namespace SDWA {
914
915enum SdwaSel : unsigned {
922 DWORD = 6,
923};
924
925enum DstUnused : unsigned {
929};
930
945
946} // namespace SDWA
947
948namespace DPP {
949
950// clang-format off
995// clang-format on
996
1002};
1003
1004} // namespace DPP
1005
1006namespace Exp {
1007
1008enum Target : unsigned {
1012 ET_NULL = 9, // Pre-GFX11
1015 ET_POS4 = 16, // GFX10+
1016 ET_POS_LAST = ET_POS4, // Highest pos used on any subtarget
1017 ET_PRIM = 20, // GFX10+
1018 ET_DUAL_SRC_BLEND0 = 21, // GFX11+
1019 ET_DUAL_SRC_BLEND1 = 22, // GFX11+
1020 ET_PARAM0 = 32, // Pre-GFX11
1021 ET_PARAM31 = 63, // Pre-GFX11
1022
1030
1032};
1033
1034} // namespace Exp
1035
1056
1057namespace VOP3PEncoding {
1058
1060 OP_SEL_HI_0 = UINT64_C(1) << 59,
1061 OP_SEL_HI_1 = UINT64_C(1) << 60,
1062 OP_SEL_HI_2 = UINT64_C(1) << 14,
1063};
1064
1065} // namespace VOP3PEncoding
1066
1067namespace ImplicitArg {
1068// Implicit kernel argument offset for code object version 5.
1081
1082} // namespace ImplicitArg
1083
1085// Enum value used in cbsz/blgp for F8F6F4 MFMA operations to select the matrix
1086// format.
1094} // namespace MFMAScaleFormats
1095
1096namespace VirtRegFlag {
1097// Virtual register flags used for various target specific handlings during
1098// codegen.
1100 // Register operand in a whole-wave mode operation.
1101 WWM_REG = 1 << 0,
1102};
1103
1104} // namespace VirtRegFlag
1105
1106} // namespace AMDGPU
1107
1108namespace AMDGPU {
1109namespace Barrier {
1110
1111enum Type { TRAP = -2, WORKGROUP = -1 };
1112
1113enum {
1115};
1116
1117} // namespace Barrier
1118} // namespace AMDGPU
1119
1120// clang-format off
1121
1122#define R_00B028_SPI_SHADER_PGM_RSRC1_PS 0x00B028
1123#define S_00B028_VGPRS(x) (((x) & 0x3F) << 0)
1124#define S_00B028_SGPRS(x) (((x) & 0x0F) << 6)
1125#define S_00B028_MEM_ORDERED(x) (((x) & 0x1) << 25)
1126#define G_00B028_MEM_ORDERED(x) (((x) >> 25) & 0x1)
1127#define C_00B028_MEM_ORDERED 0xFDFFFFFF
1128
1129#define R_00B02C_SPI_SHADER_PGM_RSRC2_PS 0x00B02C
1130#define S_00B02C_EXTRA_LDS_SIZE(x) (((x) & 0xFF) << 8)
1131#define R_00B128_SPI_SHADER_PGM_RSRC1_VS 0x00B128
1132#define S_00B128_MEM_ORDERED(x) (((x) & 0x1) << 27)
1133#define G_00B128_MEM_ORDERED(x) (((x) >> 27) & 0x1)
1134#define C_00B128_MEM_ORDERED 0xF7FFFFFF
1135
1136#define R_00B228_SPI_SHADER_PGM_RSRC1_GS 0x00B228
1137#define S_00B228_WGP_MODE(x) (((x) & 0x1) << 27)
1138#define G_00B228_WGP_MODE(x) (((x) >> 27) & 0x1)
1139#define C_00B228_WGP_MODE 0xF7FFFFFF
1140#define S_00B228_MEM_ORDERED(x) (((x) & 0x1) << 25)
1141#define G_00B228_MEM_ORDERED(x) (((x) >> 25) & 0x1)
1142#define C_00B228_MEM_ORDERED 0xFDFFFFFF
1143
1144#define R_00B328_SPI_SHADER_PGM_RSRC1_ES 0x00B328
1145#define R_00B428_SPI_SHADER_PGM_RSRC1_HS 0x00B428
1146#define S_00B428_WGP_MODE(x) (((x) & 0x1) << 26)
1147#define G_00B428_WGP_MODE(x) (((x) >> 26) & 0x1)
1148#define C_00B428_WGP_MODE 0xFBFFFFFF
1149#define S_00B428_MEM_ORDERED(x) (((x) & 0x1) << 24)
1150#define G_00B428_MEM_ORDERED(x) (((x) >> 24) & 0x1)
1151#define C_00B428_MEM_ORDERED 0xFEFFFFFF
1152
1153#define R_00B528_SPI_SHADER_PGM_RSRC1_LS 0x00B528
1154
1155#define R_00B84C_COMPUTE_PGM_RSRC2 0x00B84C
1156#define S_00B84C_SCRATCH_EN(x) (((x) & 0x1) << 0)
1157#define G_00B84C_SCRATCH_EN(x) (((x) >> 0) & 0x1)
1158#define C_00B84C_SCRATCH_EN 0xFFFFFFFE
1159#define S_00B84C_USER_SGPR(x) (((x) & 0x1F) << 1)
1160#define G_00B84C_USER_SGPR(x) (((x) >> 1) & 0x1F)
1161#define C_00B84C_USER_SGPR 0xFFFFFFC1
1162#define S_00B84C_TRAP_HANDLER(x) (((x) & 0x1) << 6)
1163#define G_00B84C_TRAP_HANDLER(x) (((x) >> 6) & 0x1)
1164#define C_00B84C_TRAP_HANDLER 0xFFFFFFBF
1165#define S_00B84C_TGID_X_EN(x) (((x) & 0x1) << 7)
1166#define G_00B84C_TGID_X_EN(x) (((x) >> 7) & 0x1)
1167#define C_00B84C_TGID_X_EN 0xFFFFFF7F
1168#define S_00B84C_TGID_Y_EN(x) (((x) & 0x1) << 8)
1169#define G_00B84C_TGID_Y_EN(x) (((x) >> 8) & 0x1)
1170#define C_00B84C_TGID_Y_EN 0xFFFFFEFF
1171#define S_00B84C_TGID_Z_EN(x) (((x) & 0x1) << 9)
1172#define G_00B84C_TGID_Z_EN(x) (((x) >> 9) & 0x1)
1173#define C_00B84C_TGID_Z_EN 0xFFFFFDFF
1174#define S_00B84C_TG_SIZE_EN(x) (((x) & 0x1) << 10)
1175#define G_00B84C_TG_SIZE_EN(x) (((x) >> 10) & 0x1)
1176#define C_00B84C_TG_SIZE_EN 0xFFFFFBFF
1177#define S_00B84C_TIDIG_COMP_CNT(x) (((x) & 0x03) << 11)
1178#define G_00B84C_TIDIG_COMP_CNT(x) (((x) >> 11) & 0x03)
1179#define C_00B84C_TIDIG_COMP_CNT 0xFFFFE7FF
1180/* CIK */
1181#define S_00B84C_EXCP_EN_MSB(x) (((x) & 0x03) << 13)
1182#define G_00B84C_EXCP_EN_MSB(x) (((x) >> 13) & 0x03)
1183#define C_00B84C_EXCP_EN_MSB 0xFFFF9FFF
1184/* */
1185#define S_00B84C_LDS_SIZE(x) (((x) & 0x1FF) << 15)
1186#define G_00B84C_LDS_SIZE(x) (((x) >> 15) & 0x1FF)
1187#define C_00B84C_LDS_SIZE 0xFF007FFF
1188#define S_00B84C_EXCP_EN(x) (((x) & 0x7F) << 24)
1189#define G_00B84C_EXCP_EN(x) (((x) >> 24) & 0x7F)
1190#define C_00B84C_EXCP_EN 0x80FFFFFF
1191
1192#define R_0286CC_SPI_PS_INPUT_ENA 0x0286CC
1193#define R_0286D0_SPI_PS_INPUT_ADDR 0x0286D0
1194
1195#define R_00B848_COMPUTE_PGM_RSRC1 0x00B848
1196#define S_00B848_VGPRS(x) (((x) & 0x3F) << 0)
1197#define G_00B848_VGPRS(x) (((x) >> 0) & 0x3F)
1198#define C_00B848_VGPRS 0xFFFFFFC0
1199#define S_00B848_SGPRS(x) (((x) & 0x0F) << 6)
1200#define G_00B848_SGPRS(x) (((x) >> 6) & 0x0F)
1201#define C_00B848_SGPRS 0xFFFFFC3F
1202#define S_00B848_PRIORITY(x) (((x) & 0x03) << 10)
1203#define G_00B848_PRIORITY(x) (((x) >> 10) & 0x03)
1204#define C_00B848_PRIORITY 0xFFFFF3FF
1205#define S_00B848_FLOAT_MODE(x) (((x) & 0xFF) << 12)
1206#define G_00B848_FLOAT_MODE(x) (((x) >> 12) & 0xFF)
1207#define C_00B848_FLOAT_MODE 0xFFF00FFF
1208#define S_00B848_PRIV(x) (((x) & 0x1) << 20)
1209#define G_00B848_PRIV(x) (((x) >> 20) & 0x1)
1210#define C_00B848_PRIV 0xFFEFFFFF
1211#define S_00B848_DX10_CLAMP(x) (((x) & 0x1) << 21)
1212#define G_00B848_DX10_CLAMP(x) (((x) >> 21) & 0x1)
1213#define C_00B848_DX10_CLAMP 0xFFDFFFFF
1214#define S_00B848_RR_WG_MODE(x) (((x) & 0x1) << 21)
1215#define G_00B848_RR_WG_MODE(x) (((x) >> 21) & 0x1)
1216#define C_00B848_RR_WG_MODE 0xFFDFFFFF
1217#define S_00B848_DEBUG_MODE(x) (((x) & 0x1) << 22)
1218#define G_00B848_DEBUG_MODE(x) (((x) >> 22) & 0x1)
1219#define C_00B848_DEBUG_MODE 0xFFBFFFFF
1220#define S_00B848_IEEE_MODE(x) (((x) & 0x1) << 23)
1221#define G_00B848_IEEE_MODE(x) (((x) >> 23) & 0x1)
1222#define C_00B848_IEEE_MODE 0xFF7FFFFF
1223#define S_00B848_WGP_MODE(x) (((x) & 0x1) << 29)
1224#define G_00B848_WGP_MODE(x) (((x) >> 29) & 0x1)
1225#define C_00B848_WGP_MODE 0xDFFFFFFF
1226#define S_00B848_MEM_ORDERED(x) (((x) & 0x1) << 30)
1227#define G_00B848_MEM_ORDERED(x) (((x) >> 30) & 0x1)
1228#define C_00B848_MEM_ORDERED 0xBFFFFFFF
1229#define S_00B848_FWD_PROGRESS(x) (((x) & 0x1) << 31)
1230#define G_00B848_FWD_PROGRESS(x) (((x) >> 31) & 0x1)
1231#define C_00B848_FWD_PROGRESS 0x7FFFFFFF
1232
1233// Helpers for setting FLOAT_MODE
1234#define FP_ROUND_ROUND_TO_NEAREST 0
1235#define FP_ROUND_ROUND_TO_INF 1
1236#define FP_ROUND_ROUND_TO_NEGINF 2
1237#define FP_ROUND_ROUND_TO_ZERO 3
1238
1239// Bits 3:0 control rounding mode. 1:0 control single precision, 3:2 double
1240// precision.
1241#define FP_ROUND_MODE_SP(x) ((x) & 0x3)
1242#define FP_ROUND_MODE_DP(x) (((x) & 0x3) << 2)
1243
1244#define FP_DENORM_FLUSH_IN_FLUSH_OUT 0
1245#define FP_DENORM_FLUSH_OUT 1
1246#define FP_DENORM_FLUSH_IN 2
1247#define FP_DENORM_FLUSH_NONE 3
1248
1249
1250// Bits 7:4 control denormal handling. 5:4 control single precision, 6:7 double
1251// precision.
1252#define FP_DENORM_MODE_SP(x) (((x) & 0x3) << 4)
1253#define FP_DENORM_MODE_DP(x) (((x) & 0x3) << 6)
1254
1255#define R_00B860_COMPUTE_TMPRING_SIZE 0x00B860
1256#define S_00B860_WAVESIZE_PreGFX11(x) (((x) & 0x1FFF) << 12)
1257#define S_00B860_WAVESIZE_GFX11(x) (((x) & 0x7FFF) << 12)
1258#define S_00B860_WAVESIZE_GFX12Plus(x) (((x) & 0x3FFFF) << 12)
1259
1260#define R_0286E8_SPI_TMPRING_SIZE 0x0286E8
1261#define S_0286E8_WAVESIZE_PreGFX11(x) (((x) & 0x1FFF) << 12)
1262#define S_0286E8_WAVESIZE_GFX11(x) (((x) & 0x7FFF) << 12)
1263#define S_0286E8_WAVESIZE_GFX12Plus(x) (((x) & 0x3FFFF) << 12)
1264
1265#define R_028B54_VGT_SHADER_STAGES_EN 0x028B54
1266#define S_028B54_HS_W32_EN(x) (((x) & 0x1) << 21)
1267#define S_028B54_GS_W32_EN(x) (((x) & 0x1) << 22)
1268#define S_028B54_VS_W32_EN(x) (((x) & 0x1) << 23)
1269#define R_0286D8_SPI_PS_IN_CONTROL 0x0286D8
1270#define S_0286D8_PS_W32_EN(x) (((x) & 0x1) << 15)
1271#define R_00B800_COMPUTE_DISPATCH_INITIATOR 0x00B800
1272#define S_00B800_CS_W32_EN(x) (((x) & 0x1) << 15)
1273
1274#define R_SPILLED_SGPRS 0x4
1275#define R_SPILLED_VGPRS 0x8
1276
1277// clang-format on
1278
1279} // End namespace llvm
1280
1281#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