LLVM 23.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
215
216 /// Operands with register or inline constant
227
228 // Operand for split barrier inline constant
230
231 /// Operand with 32-bit immediate that uses the constant bus.
235
236 /// Operands with an AccVGPR register or inline constant
240
241 // Operand for AV_MOV_B64_IMM_PSEUDO, which is a pair of 32-bit inline
242 // constants. Does not accept registers.
244
245 // Operand for source modifiers for VOP instructions
247
248 // Operand for SDWA instructions
250
253
256
259
262
265
266};
267}
268
269// Input operand modifiers bit-masks
270// NEG and SEXT share same bit-mask because they can't be set simultaneously.
271namespace SISrcMods {
272enum : unsigned {
273 NONE = 0,
274 NEG = 1 << 0, // Floating-point negate modifier
275 ABS = 1 << 1, // Floating-point absolute modifier
276 SEXT = 1 << 4, // Integer sign-extend modifier
277 NEG_HI = ABS, // Floating-point negate high packed component modifier.
278 OP_SEL_0 = 1 << 2,
279 OP_SEL_1 = 1 << 3,
280 DST_OP_SEL = 1 << 3 // VOP3 dst op_sel (share mask with OP_SEL_1)
281};
282}
283
284namespace SIOutMods {
285 enum : unsigned {
286 NONE = 0,
287 MUL2 = 1,
288 MUL4 = 2,
290 };
291}
292
293namespace AMDGPU {
294namespace VGPRIndexMode {
295
296enum Id : unsigned { // id of symbolic names
301
304};
305
315
316} // namespace VGPRIndexMode
317} // namespace AMDGPU
318
320 enum : unsigned {
322 VOP3 = 1,
323 SDWA = 2,
324 SDWA9 = 3,
325 DPP = 4,
327 };
328} // namespace AMDGPUAsmVariants
329
330namespace AMDGPU {
331namespace EncValues { // Encoding values of enum9/8/7 operands
332
333enum : unsigned {
348 VGPR_MIN = 256,
349 VGPR_MAX = 511,
350 IS_VGPR = 256, // Indicates VGPR or AGPR
351};
352
353} // namespace EncValues
354
355// Register codes as defined in the TableGen's HWEncoding field.
356namespace HWEncoding {
357enum : unsigned {
360 IS_VGPR = 1 << 10,
361 IS_AGPR = 1 << 11,
362 IS_HI16 = 1 << 12,
363};
364} // namespace HWEncoding
365
366namespace CPol {
367
368enum CPol {
369 GLC = 1,
370 SLC = 2,
371 DLC = 4,
372 SCC = 16,
378
379 // Below are GFX12+ cache policy bits
380
381 // Temporal hint
382 TH = 0x7, // All TH bits
383 TH_RT = 0, // regular
384 TH_NT = 1, // non-temporal
385 TH_HT = 2, // high-temporal
386 TH_LU = 3, // last use
387 TH_WB = 3, // regular (CU, SE), high-temporal with write-back (MALL)
388 TH_NT_RT = 4, // non-temporal (CU, SE), regular (MALL)
389 TH_RT_NT = 5, // regular (CU, SE), non-temporal (MALL)
390 TH_NT_HT = 6, // non-temporal (CU, SE), high-temporal (MALL)
391 TH_NT_WB = 7, // non-temporal (CU, SE), high-temporal with write-back (MALL)
392 TH_BYPASS = 3, // only to be used with scope = 3
393
394 TH_RESERVED = 7, // unused value for load insts
395
396 // Bits of TH for atomics
397 TH_ATOMIC_RETURN = GLC, // Returning vs non-returning
398 TH_ATOMIC_NT = SLC, // Non-temporal vs regular
399 TH_ATOMIC_CASCADE = 4, // Cascading vs regular
400
401 // Scope
404 SCOPE = SCOPE_MASK << SCOPE_SHIFT, // All Scope bits
409
410 NV = 1 << 5, // Non-volatile bit
411
412 SWZ = 1 << 6, // Swizzle bit
413
414 SCAL = 1 << 11, // Scale offset bit
415
416 ALL = TH | SCOPE | NV,
417
418 // Helper bits
419 TH_TYPE_LOAD = 1 << 7, // TH_LOAD policy
420 TH_TYPE_STORE = 1 << 8, // TH_STORE policy
421 TH_TYPE_ATOMIC = 1 << 9, // TH_ATOMIC policy
422 TH_REAL_BYPASS = 1 << 10, // is TH=3 bypass policy or not
423
424 // Volatile (used to preserve/signal operation volatility for buffer
425 // operations not a real instruction bit)
426 VOLATILE = 1 << 31,
427 // The set of "cache policy" bits used for compiler features that
428 // do not correspond to handware features.
430};
431
432} // namespace CPol
433
434namespace SendMsg { // Encoding of SIMM16 used in s_sendmsg* insns.
435
436enum Id { // Message ID, width(4) [3:0].
438
439 ID_GS_PreGFX11 = 2, // replaced in GFX11
440 ID_GS_DONE_PreGFX11 = 3, // replaced in GFX11
441
442 ID_HS_TESSFACTOR_GFX11Plus = 2, // reused in GFX11
443 ID_DEALLOC_VGPRS_GFX11Plus = 3, // reused in GFX11
444
445 ID_SAVEWAVE = 4, // added in GFX8, removed in GFX11
446 ID_STALL_WAVE_GEN = 5, // added in GFX9, removed in GFX12
447 ID_HALT_WAVES = 6, // added in GFX9, removed in GFX12
448 ID_ORDERED_PS_DONE = 7, // added in GFX9, removed in GFX11
449 ID_EARLY_PRIM_DEALLOC = 8, // added in GFX9, removed in GFX10
450 ID_GS_ALLOC_REQ = 9, // added in GFX9
451 ID_GET_DOORBELL = 10, // added in GFX9, removed in GFX11
452 ID_SAVEWAVE_HAS_TDM = 10, // added in GFX1250
453 ID_GET_DDID = 11, // added in GFX10, removed in GFX11
455
464
465 ID_RTN_GET_CLUSTER_BARRIER_STATE = 136, // added in GFX1250
466
469};
470
471enum Op { // Both GS and SYS operation IDs.
474 // Bits used for operation encoding
476 OP_MASK_ = (((1 << OP_WIDTH_) - 1) << OP_SHIFT_),
477 // GS operations are encoded in bits 5:4
483 // SYS operations are encoded in bits 6:4
489};
490
500
501} // namespace SendMsg
502
503namespace Hwreg { // Encoding of SIMM16 used in s_setreg/getreg* insns.
504
558
559enum Offset : unsigned { // Offset, (5) [10:6]
561 OFFSET_ME_ID = 8, // in HW_ID2
562};
563
565 FP_ROUND_MASK = 0xf << 0, // Bits 0..3
566 FP_DENORM_MASK = 0xf << 4, // Bits 4..7
569 LOD_CLAMP_MASK = 1 << 10,
570 DEBUG_MASK = 1 << 11,
571
572 // EXCP_EN fields.
580
582 VSKIP_MASK = 1 << 28,
583 CSP_MASK = 0x7u << 29, // Bits 29..31
584
585 // GFX1250
586 DST_VGPR_MSB = 0x3 << 12,
587 SRC0_VGPR_MSB = 0x3 << 14,
588 SRC1_VGPR_MSB = 0x3 << 16,
589 SRC2_VGPR_MSB = 0x3 << 18,
590 VGPR_MSB_MASK = 0xff << 12, // Bits 12..19
591
592 REPLAY_MODE = 1 << 25,
594};
595
596} // namespace Hwreg
597
667
668namespace UfmtGFX10 {
669enum UnifiedFormat : int64_t {
671
678
686
693
697
705
713
721
728
735
742
746
754
761
764};
765
766} // namespace UfmtGFX10
767
768namespace UfmtGFX11 {
769enum UnifiedFormat : int64_t {
771
778
786
793
797
805
807
809
814
821
828
832
840
847
850};
851
852} // namespace UfmtGFX11
853
854namespace Swizzle { // Encoding of swizzle macro used in ds_swizzle_b32.
855
865
866// clang-format off
867enum EncBits : unsigned {
868
869 // swizzle mode encodings
870
873
876
877 FFT_MODE_ENC = 0xE000,
878
881
883 FFT_MODE_LO = 0xE000,
884
885 // QUAD_PERM encodings
886
891
892 // BITMASK_PERM encodings
893
897
901
902 // FFT encodings
903
906
907 // ROTATE encodings
909 ROTATE_DIR_SHIFT = 10, // bit position of rotate direction
911 ROTATE_SIZE_SHIFT = 5, // bit position of rotate size
913};
914// clang-format on
915
916} // namespace Swizzle
917
918namespace SDWA {
919
920enum SdwaSel : unsigned {
927 DWORD = 6,
928};
929
930enum DstUnused : unsigned {
934};
935
950
951} // namespace SDWA
952
953namespace DPP {
954
955// clang-format off
1000// clang-format on
1001
1008
1009} // namespace DPP
1010
1011namespace Exp {
1012
1013enum Target : unsigned {
1017 ET_NULL = 9, // Pre-GFX11
1020 ET_POS4 = 16, // GFX10+
1021 ET_POS_LAST = ET_POS4, // Highest pos used on any subtarget
1022 ET_PRIM = 20, // GFX10+
1023 ET_DUAL_SRC_BLEND0 = 21, // GFX11+
1024 ET_DUAL_SRC_BLEND1 = 22, // GFX11+
1025 ET_PARAM0 = 32, // Pre-GFX11
1026 ET_PARAM31 = 63, // Pre-GFX11
1027
1035
1037};
1038
1039} // namespace Exp
1040
1061
1062namespace VOP3PEncoding {
1063
1065 OP_SEL_HI_0 = UINT64_C(1) << 59,
1066 OP_SEL_HI_1 = UINT64_C(1) << 60,
1067 OP_SEL_HI_2 = UINT64_C(1) << 14,
1068};
1069
1070} // namespace VOP3PEncoding
1071
1072namespace ImplicitArg {
1073// Implicit kernel argument offset for code object version 5.
1086
1087} // namespace ImplicitArg
1088
1090// Enum value used in cbsz/blgp for F8F6F4 MFMA operations to select the matrix
1091// format.
1099} // namespace MFMAScaleFormats
1100
1101namespace VirtRegFlag {
1102// Virtual register flags used for various target specific handlings during
1103// codegen.
1105 // Register operand in a whole-wave mode operation.
1106 WWM_REG = 1 << 0,
1107};
1108
1109} // namespace VirtRegFlag
1110
1111} // namespace AMDGPU
1112
1113namespace AMDGPU {
1114namespace Barrier {
1115
1124
1125enum {
1127};
1128
1129} // namespace Barrier
1130} // namespace AMDGPU
1131
1132// clang-format off
1133
1134#define R_00B028_SPI_SHADER_PGM_RSRC1_PS 0x00B028
1135#define S_00B028_VGPRS(x) (((x) & 0x3F) << 0)
1136#define S_00B028_SGPRS(x) (((x) & 0x0F) << 6)
1137#define S_00B028_MEM_ORDERED(x) (((x) & 0x1) << 25)
1138#define G_00B028_MEM_ORDERED(x) (((x) >> 25) & 0x1)
1139#define C_00B028_MEM_ORDERED 0xFDFFFFFF
1140
1141#define R_00B02C_SPI_SHADER_PGM_RSRC2_PS 0x00B02C
1142#define S_00B02C_EXTRA_LDS_SIZE(x) (((x) & 0xFF) << 8)
1143#define R_00B128_SPI_SHADER_PGM_RSRC1_VS 0x00B128
1144#define S_00B128_MEM_ORDERED(x) (((x) & 0x1) << 27)
1145#define G_00B128_MEM_ORDERED(x) (((x) >> 27) & 0x1)
1146#define C_00B128_MEM_ORDERED 0xF7FFFFFF
1147
1148#define R_00B228_SPI_SHADER_PGM_RSRC1_GS 0x00B228
1149#define S_00B228_WGP_MODE(x) (((x) & 0x1) << 27)
1150#define G_00B228_WGP_MODE(x) (((x) >> 27) & 0x1)
1151#define C_00B228_WGP_MODE 0xF7FFFFFF
1152#define S_00B228_MEM_ORDERED(x) (((x) & 0x1) << 25)
1153#define G_00B228_MEM_ORDERED(x) (((x) >> 25) & 0x1)
1154#define C_00B228_MEM_ORDERED 0xFDFFFFFF
1155
1156#define R_00B328_SPI_SHADER_PGM_RSRC1_ES 0x00B328
1157#define R_00B428_SPI_SHADER_PGM_RSRC1_HS 0x00B428
1158#define S_00B428_WGP_MODE(x) (((x) & 0x1) << 26)
1159#define G_00B428_WGP_MODE(x) (((x) >> 26) & 0x1)
1160#define C_00B428_WGP_MODE 0xFBFFFFFF
1161#define S_00B428_MEM_ORDERED(x) (((x) & 0x1) << 24)
1162#define G_00B428_MEM_ORDERED(x) (((x) >> 24) & 0x1)
1163#define C_00B428_MEM_ORDERED 0xFEFFFFFF
1164
1165#define R_00B528_SPI_SHADER_PGM_RSRC1_LS 0x00B528
1166
1167#define R_00B84C_COMPUTE_PGM_RSRC2 0x00B84C
1168#define S_00B84C_SCRATCH_EN(x) (((x) & 0x1) << 0)
1169#define G_00B84C_SCRATCH_EN(x) (((x) >> 0) & 0x1)
1170#define C_00B84C_SCRATCH_EN 0xFFFFFFFE
1171#define S_00B84C_USER_SGPR(x) (((x) & 0x1F) << 1)
1172#define G_00B84C_USER_SGPR(x) (((x) >> 1) & 0x1F)
1173#define C_00B84C_USER_SGPR 0xFFFFFFC1
1174#define S_00B84C_TRAP_HANDLER(x) (((x) & 0x1) << 6)
1175#define G_00B84C_TRAP_HANDLER(x) (((x) >> 6) & 0x1)
1176#define C_00B84C_TRAP_HANDLER 0xFFFFFFBF
1177#define S_00B84C_TGID_X_EN(x) (((x) & 0x1) << 7)
1178#define G_00B84C_TGID_X_EN(x) (((x) >> 7) & 0x1)
1179#define C_00B84C_TGID_X_EN 0xFFFFFF7F
1180#define S_00B84C_TGID_Y_EN(x) (((x) & 0x1) << 8)
1181#define G_00B84C_TGID_Y_EN(x) (((x) >> 8) & 0x1)
1182#define C_00B84C_TGID_Y_EN 0xFFFFFEFF
1183#define S_00B84C_TGID_Z_EN(x) (((x) & 0x1) << 9)
1184#define G_00B84C_TGID_Z_EN(x) (((x) >> 9) & 0x1)
1185#define C_00B84C_TGID_Z_EN 0xFFFFFDFF
1186#define S_00B84C_TG_SIZE_EN(x) (((x) & 0x1) << 10)
1187#define G_00B84C_TG_SIZE_EN(x) (((x) >> 10) & 0x1)
1188#define C_00B84C_TG_SIZE_EN 0xFFFFFBFF
1189#define S_00B84C_TIDIG_COMP_CNT(x) (((x) & 0x03) << 11)
1190#define G_00B84C_TIDIG_COMP_CNT(x) (((x) >> 11) & 0x03)
1191#define C_00B84C_TIDIG_COMP_CNT 0xFFFFE7FF
1192/* CIK */
1193#define S_00B84C_EXCP_EN_MSB(x) (((x) & 0x03) << 13)
1194#define G_00B84C_EXCP_EN_MSB(x) (((x) >> 13) & 0x03)
1195#define C_00B84C_EXCP_EN_MSB 0xFFFF9FFF
1196/* */
1197#define S_00B84C_LDS_SIZE(x) (((x) & 0x1FF) << 15)
1198#define G_00B84C_LDS_SIZE(x) (((x) >> 15) & 0x1FF)
1199#define C_00B84C_LDS_SIZE 0xFF007FFF
1200#define S_00B84C_EXCP_EN(x) (((x) & 0x7F) << 24)
1201#define G_00B84C_EXCP_EN(x) (((x) >> 24) & 0x7F)
1202#define C_00B84C_EXCP_EN 0x80FFFFFF
1203
1204#define R_0286CC_SPI_PS_INPUT_ENA 0x0286CC
1205#define R_0286D0_SPI_PS_INPUT_ADDR 0x0286D0
1206
1207#define R_00B848_COMPUTE_PGM_RSRC1 0x00B848
1208#define S_00B848_VGPRS(x) (((x) & 0x3F) << 0)
1209#define G_00B848_VGPRS(x) (((x) >> 0) & 0x3F)
1210#define C_00B848_VGPRS 0xFFFFFFC0
1211#define S_00B848_SGPRS(x) (((x) & 0x0F) << 6)
1212#define G_00B848_SGPRS(x) (((x) >> 6) & 0x0F)
1213#define C_00B848_SGPRS 0xFFFFFC3F
1214#define S_00B848_PRIORITY(x) (((x) & 0x03) << 10)
1215#define G_00B848_PRIORITY(x) (((x) >> 10) & 0x03)
1216#define C_00B848_PRIORITY 0xFFFFF3FF
1217#define S_00B848_FLOAT_MODE(x) (((x) & 0xFF) << 12)
1218#define G_00B848_FLOAT_MODE(x) (((x) >> 12) & 0xFF)
1219#define C_00B848_FLOAT_MODE 0xFFF00FFF
1220#define S_00B848_PRIV(x) (((x) & 0x1) << 20)
1221#define G_00B848_PRIV(x) (((x) >> 20) & 0x1)
1222#define C_00B848_PRIV 0xFFEFFFFF
1223#define S_00B848_DX10_CLAMP(x) (((x) & 0x1) << 21)
1224#define G_00B848_DX10_CLAMP(x) (((x) >> 21) & 0x1)
1225#define C_00B848_DX10_CLAMP 0xFFDFFFFF
1226#define S_00B848_RR_WG_MODE(x) (((x) & 0x1) << 21)
1227#define G_00B848_RR_WG_MODE(x) (((x) >> 21) & 0x1)
1228#define C_00B848_RR_WG_MODE 0xFFDFFFFF
1229#define S_00B848_DEBUG_MODE(x) (((x) & 0x1) << 22)
1230#define G_00B848_DEBUG_MODE(x) (((x) >> 22) & 0x1)
1231#define C_00B848_DEBUG_MODE 0xFFBFFFFF
1232#define S_00B848_IEEE_MODE(x) (((x) & 0x1) << 23)
1233#define G_00B848_IEEE_MODE(x) (((x) >> 23) & 0x1)
1234#define C_00B848_IEEE_MODE 0xFF7FFFFF
1235#define S_00B848_WGP_MODE(x) (((x) & 0x1) << 29)
1236#define G_00B848_WGP_MODE(x) (((x) >> 29) & 0x1)
1237#define C_00B848_WGP_MODE 0xDFFFFFFF
1238#define S_00B848_MEM_ORDERED(x) (((x) & 0x1) << 30)
1239#define G_00B848_MEM_ORDERED(x) (((x) >> 30) & 0x1)
1240#define C_00B848_MEM_ORDERED 0xBFFFFFFF
1241#define S_00B848_FWD_PROGRESS(x) (((x) & 0x1) << 31)
1242#define G_00B848_FWD_PROGRESS(x) (((x) >> 31) & 0x1)
1243#define C_00B848_FWD_PROGRESS 0x7FFFFFFF
1244
1245// Helpers for setting FLOAT_MODE
1246#define FP_ROUND_ROUND_TO_NEAREST 0
1247#define FP_ROUND_ROUND_TO_INF 1
1248#define FP_ROUND_ROUND_TO_NEGINF 2
1249#define FP_ROUND_ROUND_TO_ZERO 3
1250
1251// Bits 3:0 control rounding mode. 1:0 control single precision, 3:2 double
1252// precision.
1253#define FP_ROUND_MODE_SP(x) ((x) & 0x3)
1254#define FP_ROUND_MODE_DP(x) (((x) & 0x3) << 2)
1255
1256#define FP_DENORM_FLUSH_IN_FLUSH_OUT 0
1257#define FP_DENORM_FLUSH_OUT 1
1258#define FP_DENORM_FLUSH_IN 2
1259#define FP_DENORM_FLUSH_NONE 3
1260
1261
1262// Bits 7:4 control denormal handling. 5:4 control single precision, 6:7 double
1263// precision.
1264#define FP_DENORM_MODE_SP(x) (((x) & 0x3) << 4)
1265#define FP_DENORM_MODE_DP(x) (((x) & 0x3) << 6)
1266
1267#define R_00B860_COMPUTE_TMPRING_SIZE 0x00B860
1268#define S_00B860_WAVESIZE_PreGFX11(x) (((x) & 0x1FFF) << 12)
1269#define S_00B860_WAVESIZE_GFX11(x) (((x) & 0x7FFF) << 12)
1270#define S_00B860_WAVESIZE_GFX12Plus(x) (((x) & 0x3FFFF) << 12)
1271
1272#define R_0286E8_SPI_TMPRING_SIZE 0x0286E8
1273#define S_0286E8_WAVESIZE_PreGFX11(x) (((x) & 0x1FFF) << 12)
1274#define S_0286E8_WAVESIZE_GFX11(x) (((x) & 0x7FFF) << 12)
1275#define S_0286E8_WAVESIZE_GFX12Plus(x) (((x) & 0x3FFFF) << 12)
1276
1277#define R_028B54_VGT_SHADER_STAGES_EN 0x028B54
1278#define S_028B54_HS_W32_EN(x) (((x) & 0x1) << 21)
1279#define S_028B54_GS_W32_EN(x) (((x) & 0x1) << 22)
1280#define S_028B54_VS_W32_EN(x) (((x) & 0x1) << 23)
1281#define R_0286D8_SPI_PS_IN_CONTROL 0x0286D8
1282#define S_0286D8_PS_W32_EN(x) (((x) & 0x1) << 15)
1283#define R_00B800_COMPUTE_DISPATCH_INITIATOR 0x00B800
1284#define S_00B800_CS_W32_EN(x) (((x) & 0x1) << 15)
1285
1286#define R_SPILLED_SGPRS 0x4
1287#define R_SPILLED_VGPRS 0x8
1288
1289// clang-format on
1290
1291} // End namespace llvm
1292
1293#endif
@ OPERAND_KIMM32
Operand with 32-bit immediate that uses the constant bus.
Definition SIDefines.h:232
@ OPERAND_REG_INLINE_C_LAST
Definition SIDefines.h:255
@ OPERAND_REG_IMM_INT64
Definition SIDefines.h:202
@ OPERAND_REG_IMM_V2FP16
Definition SIDefines.h:209
@ OPERAND_REG_INLINE_C_FP64
Definition SIDefines.h:223
@ OPERAND_REG_INLINE_C_BF16
Definition SIDefines.h:220
@ OPERAND_REG_IMM_FIRST
Definition SIDefines.h:251
@ OPERAND_REG_INLINE_C_V2BF16
Definition SIDefines.h:225
@ OPERAND_REG_IMM_V2INT16
Definition SIDefines.h:211
@ 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:257
@ OPERAND_REG_IMM_FP16
Definition SIDefines.h:207
@ OPERAND_REG_IMM_V2FP16_SPLAT
Definition SIDefines.h:210
@ OPERAND_REG_INLINE_C_INT64
Definition SIDefines.h:219
@ OPERAND_REG_INLINE_C_INT16
Operands with register or inline constant.
Definition SIDefines.h:217
@ OPERAND_REG_IMM_NOINLINE_V2FP16
Definition SIDefines.h:212
@ OPERAND_REG_IMM_FP64
Definition SIDefines.h:205
@ OPERAND_REG_INLINE_C_V2FP16
Definition SIDefines.h:226
@ OPERAND_REG_INLINE_AC_INT32
Operands with an AccVGPR register or inline constant.
Definition SIDefines.h:237
@ OPERAND_REG_INLINE_AC_FP32
Definition SIDefines.h:238
@ OPERAND_REG_IMM_V2INT32
Definition SIDefines.h:213
@ OPERAND_SDWA_VOPC_DST
Definition SIDefines.h:249
@ OPERAND_REG_IMM_FP32
Definition SIDefines.h:204
@ OPERAND_REG_INLINE_C_FIRST
Definition SIDefines.h:254
@ OPERAND_REG_INLINE_C_FP32
Definition SIDefines.h:222
@ OPERAND_REG_INLINE_AC_LAST
Definition SIDefines.h:258
@ OPERAND_REG_IMM_LAST
Definition SIDefines.h:252
@ OPERAND_REG_INLINE_C_INT32
Definition SIDefines.h:218
@ OPERAND_REG_INLINE_C_V2INT16
Definition SIDefines.h:224
@ OPERAND_INLINE_C_AV64_PSEUDO
Definition SIDefines.h:243
@ OPERAND_REG_IMM_V2FP32
Definition SIDefines.h:214
@ OPERAND_REG_INLINE_AC_FP64
Definition SIDefines.h:239
@ OPERAND_REG_INLINE_C_FP16
Definition SIDefines.h:221
@ OPERAND_REG_IMM_INT16
Definition SIDefines.h:203
@ OPERAND_INLINE_SPLIT_BARRIER_INT32
Definition SIDefines.h:229
@ OPERAND_FIRST_TARGET
Definition MCInstrDesc.h:79
This is an optimization pass for GlobalISel generic memory operations.
Definition Types.h:26
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