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