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
556
557enum Offset : unsigned { // Offset, (5) [10:6]
559 OFFSET_ME_ID = 8, // in HW_ID2
560};
561
563 FP_ROUND_MASK = 0xf << 0, // Bits 0..3
564 FP_DENORM_MASK = 0xf << 4, // Bits 4..7
567 LOD_CLAMP_MASK = 1 << 10,
568 DEBUG_MASK = 1 << 11,
569
570 // EXCP_EN fields.
578
580 VSKIP_MASK = 1 << 28,
581 CSP_MASK = 0x7u << 29, // Bits 29..31
582
583 // GFX1250
584 DST_VGPR_MSB = 1 << 12,
585 SRC0_VGPR_MSB = 1 << 13,
586 SRC1_VGPR_MSB = 1 << 14,
587 SRC2_VGPR_MSB = 1 << 15,
588 VGPR_MSB_MASK = 0xf << 12, // Bits 12..15
589
590 REPLAY_MODE = 1 << 25,
592};
593
594} // namespace Hwreg
595
665
666namespace UfmtGFX10 {
667enum UnifiedFormat : int64_t {
669
676
684
691
695
703
711
719
726
733
740
744
752
759
762};
763
764} // namespace UfmtGFX10
765
766namespace UfmtGFX11 {
767enum UnifiedFormat : int64_t {
769
776
784
791
795
803
805
807
812
819
826
830
838
845
848};
849
850} // namespace UfmtGFX11
851
852namespace Swizzle { // Encoding of swizzle macro used in ds_swizzle_b32.
853
863
864// clang-format off
865enum EncBits : unsigned {
866
867 // swizzle mode encodings
868
871
874
875 FFT_MODE_ENC = 0xE000,
876
879
881 FFT_MODE_LO = 0xE000,
882
883 // QUAD_PERM encodings
884
889
890 // BITMASK_PERM encodings
891
895
899
900 // FFT encodings
901
904
905 // ROTATE encodings
907 ROTATE_DIR_SHIFT = 10, // bit position of rotate direction
909 ROTATE_SIZE_SHIFT = 5, // bit position of rotate size
911};
912// clang-format on
913
914} // namespace Swizzle
915
916namespace SDWA {
917
918enum SdwaSel : unsigned {
925 DWORD = 6,
926};
927
928enum DstUnused : unsigned {
932};
933
948
949} // namespace SDWA
950
951namespace DPP {
952
953// clang-format off
998// clang-format on
999
1006
1007} // namespace DPP
1008
1009namespace Exp {
1010
1011enum Target : unsigned {
1015 ET_NULL = 9, // Pre-GFX11
1018 ET_POS4 = 16, // GFX10+
1019 ET_POS_LAST = ET_POS4, // Highest pos used on any subtarget
1020 ET_PRIM = 20, // GFX10+
1021 ET_DUAL_SRC_BLEND0 = 21, // GFX11+
1022 ET_DUAL_SRC_BLEND1 = 22, // GFX11+
1023 ET_PARAM0 = 32, // Pre-GFX11
1024 ET_PARAM31 = 63, // Pre-GFX11
1025
1033
1035};
1036
1037} // namespace Exp
1038
1059
1060namespace VOP3PEncoding {
1061
1063 OP_SEL_HI_0 = UINT64_C(1) << 59,
1064 OP_SEL_HI_1 = UINT64_C(1) << 60,
1065 OP_SEL_HI_2 = UINT64_C(1) << 14,
1066};
1067
1068} // namespace VOP3PEncoding
1069
1070namespace ImplicitArg {
1071// Implicit kernel argument offset for code object version 5.
1084
1085} // namespace ImplicitArg
1086
1088// Enum value used in cbsz/blgp for F8F6F4 MFMA operations to select the matrix
1089// format.
1097} // namespace MFMAScaleFormats
1098
1099namespace VirtRegFlag {
1100// Virtual register flags used for various target specific handlings during
1101// codegen.
1103 // Register operand in a whole-wave mode operation.
1104 WWM_REG = 1 << 0,
1105};
1106
1107} // namespace VirtRegFlag
1108
1109} // namespace AMDGPU
1110
1111namespace AMDGPU {
1112namespace Barrier {
1113
1122
1123enum {
1125};
1126
1127} // namespace Barrier
1128} // namespace AMDGPU
1129
1130// clang-format off
1131
1132#define R_00B028_SPI_SHADER_PGM_RSRC1_PS 0x00B028
1133#define S_00B028_VGPRS(x) (((x) & 0x3F) << 0)
1134#define S_00B028_SGPRS(x) (((x) & 0x0F) << 6)
1135#define S_00B028_MEM_ORDERED(x) (((x) & 0x1) << 25)
1136#define G_00B028_MEM_ORDERED(x) (((x) >> 25) & 0x1)
1137#define C_00B028_MEM_ORDERED 0xFDFFFFFF
1138
1139#define R_00B02C_SPI_SHADER_PGM_RSRC2_PS 0x00B02C
1140#define S_00B02C_EXTRA_LDS_SIZE(x) (((x) & 0xFF) << 8)
1141#define R_00B128_SPI_SHADER_PGM_RSRC1_VS 0x00B128
1142#define S_00B128_MEM_ORDERED(x) (((x) & 0x1) << 27)
1143#define G_00B128_MEM_ORDERED(x) (((x) >> 27) & 0x1)
1144#define C_00B128_MEM_ORDERED 0xF7FFFFFF
1145
1146#define R_00B228_SPI_SHADER_PGM_RSRC1_GS 0x00B228
1147#define S_00B228_WGP_MODE(x) (((x) & 0x1) << 27)
1148#define G_00B228_WGP_MODE(x) (((x) >> 27) & 0x1)
1149#define C_00B228_WGP_MODE 0xF7FFFFFF
1150#define S_00B228_MEM_ORDERED(x) (((x) & 0x1) << 25)
1151#define G_00B228_MEM_ORDERED(x) (((x) >> 25) & 0x1)
1152#define C_00B228_MEM_ORDERED 0xFDFFFFFF
1153
1154#define R_00B328_SPI_SHADER_PGM_RSRC1_ES 0x00B328
1155#define R_00B428_SPI_SHADER_PGM_RSRC1_HS 0x00B428
1156#define S_00B428_WGP_MODE(x) (((x) & 0x1) << 26)
1157#define G_00B428_WGP_MODE(x) (((x) >> 26) & 0x1)
1158#define C_00B428_WGP_MODE 0xFBFFFFFF
1159#define S_00B428_MEM_ORDERED(x) (((x) & 0x1) << 24)
1160#define G_00B428_MEM_ORDERED(x) (((x) >> 24) & 0x1)
1161#define C_00B428_MEM_ORDERED 0xFEFFFFFF
1162
1163#define R_00B528_SPI_SHADER_PGM_RSRC1_LS 0x00B528
1164
1165#define R_00B84C_COMPUTE_PGM_RSRC2 0x00B84C
1166#define S_00B84C_SCRATCH_EN(x) (((x) & 0x1) << 0)
1167#define G_00B84C_SCRATCH_EN(x) (((x) >> 0) & 0x1)
1168#define C_00B84C_SCRATCH_EN 0xFFFFFFFE
1169#define S_00B84C_USER_SGPR(x) (((x) & 0x1F) << 1)
1170#define G_00B84C_USER_SGPR(x) (((x) >> 1) & 0x1F)
1171#define C_00B84C_USER_SGPR 0xFFFFFFC1
1172#define S_00B84C_TRAP_HANDLER(x) (((x) & 0x1) << 6)
1173#define G_00B84C_TRAP_HANDLER(x) (((x) >> 6) & 0x1)
1174#define C_00B84C_TRAP_HANDLER 0xFFFFFFBF
1175#define S_00B84C_TGID_X_EN(x) (((x) & 0x1) << 7)
1176#define G_00B84C_TGID_X_EN(x) (((x) >> 7) & 0x1)
1177#define C_00B84C_TGID_X_EN 0xFFFFFF7F
1178#define S_00B84C_TGID_Y_EN(x) (((x) & 0x1) << 8)
1179#define G_00B84C_TGID_Y_EN(x) (((x) >> 8) & 0x1)
1180#define C_00B84C_TGID_Y_EN 0xFFFFFEFF
1181#define S_00B84C_TGID_Z_EN(x) (((x) & 0x1) << 9)
1182#define G_00B84C_TGID_Z_EN(x) (((x) >> 9) & 0x1)
1183#define C_00B84C_TGID_Z_EN 0xFFFFFDFF
1184#define S_00B84C_TG_SIZE_EN(x) (((x) & 0x1) << 10)
1185#define G_00B84C_TG_SIZE_EN(x) (((x) >> 10) & 0x1)
1186#define C_00B84C_TG_SIZE_EN 0xFFFFFBFF
1187#define S_00B84C_TIDIG_COMP_CNT(x) (((x) & 0x03) << 11)
1188#define G_00B84C_TIDIG_COMP_CNT(x) (((x) >> 11) & 0x03)
1189#define C_00B84C_TIDIG_COMP_CNT 0xFFFFE7FF
1190/* CIK */
1191#define S_00B84C_EXCP_EN_MSB(x) (((x) & 0x03) << 13)
1192#define G_00B84C_EXCP_EN_MSB(x) (((x) >> 13) & 0x03)
1193#define C_00B84C_EXCP_EN_MSB 0xFFFF9FFF
1194/* */
1195#define S_00B84C_LDS_SIZE(x) (((x) & 0x1FF) << 15)
1196#define G_00B84C_LDS_SIZE(x) (((x) >> 15) & 0x1FF)
1197#define C_00B84C_LDS_SIZE 0xFF007FFF
1198#define S_00B84C_EXCP_EN(x) (((x) & 0x7F) << 24)
1199#define G_00B84C_EXCP_EN(x) (((x) >> 24) & 0x7F)
1200#define C_00B84C_EXCP_EN 0x80FFFFFF
1201
1202#define R_0286CC_SPI_PS_INPUT_ENA 0x0286CC
1203#define R_0286D0_SPI_PS_INPUT_ADDR 0x0286D0
1204
1205#define R_00B848_COMPUTE_PGM_RSRC1 0x00B848
1206#define S_00B848_VGPRS(x) (((x) & 0x3F) << 0)
1207#define G_00B848_VGPRS(x) (((x) >> 0) & 0x3F)
1208#define C_00B848_VGPRS 0xFFFFFFC0
1209#define S_00B848_SGPRS(x) (((x) & 0x0F) << 6)
1210#define G_00B848_SGPRS(x) (((x) >> 6) & 0x0F)
1211#define C_00B848_SGPRS 0xFFFFFC3F
1212#define S_00B848_PRIORITY(x) (((x) & 0x03) << 10)
1213#define G_00B848_PRIORITY(x) (((x) >> 10) & 0x03)
1214#define C_00B848_PRIORITY 0xFFFFF3FF
1215#define S_00B848_FLOAT_MODE(x) (((x) & 0xFF) << 12)
1216#define G_00B848_FLOAT_MODE(x) (((x) >> 12) & 0xFF)
1217#define C_00B848_FLOAT_MODE 0xFFF00FFF
1218#define S_00B848_PRIV(x) (((x) & 0x1) << 20)
1219#define G_00B848_PRIV(x) (((x) >> 20) & 0x1)
1220#define C_00B848_PRIV 0xFFEFFFFF
1221#define S_00B848_DX10_CLAMP(x) (((x) & 0x1) << 21)
1222#define G_00B848_DX10_CLAMP(x) (((x) >> 21) & 0x1)
1223#define C_00B848_DX10_CLAMP 0xFFDFFFFF
1224#define S_00B848_RR_WG_MODE(x) (((x) & 0x1) << 21)
1225#define G_00B848_RR_WG_MODE(x) (((x) >> 21) & 0x1)
1226#define C_00B848_RR_WG_MODE 0xFFDFFFFF
1227#define S_00B848_DEBUG_MODE(x) (((x) & 0x1) << 22)
1228#define G_00B848_DEBUG_MODE(x) (((x) >> 22) & 0x1)
1229#define C_00B848_DEBUG_MODE 0xFFBFFFFF
1230#define S_00B848_IEEE_MODE(x) (((x) & 0x1) << 23)
1231#define G_00B848_IEEE_MODE(x) (((x) >> 23) & 0x1)
1232#define C_00B848_IEEE_MODE 0xFF7FFFFF
1233#define S_00B848_WGP_MODE(x) (((x) & 0x1) << 29)
1234#define G_00B848_WGP_MODE(x) (((x) >> 29) & 0x1)
1235#define C_00B848_WGP_MODE 0xDFFFFFFF
1236#define S_00B848_MEM_ORDERED(x) (((x) & 0x1) << 30)
1237#define G_00B848_MEM_ORDERED(x) (((x) >> 30) & 0x1)
1238#define C_00B848_MEM_ORDERED 0xBFFFFFFF
1239#define S_00B848_FWD_PROGRESS(x) (((x) & 0x1) << 31)
1240#define G_00B848_FWD_PROGRESS(x) (((x) >> 31) & 0x1)
1241#define C_00B848_FWD_PROGRESS 0x7FFFFFFF
1242
1243// Helpers for setting FLOAT_MODE
1244#define FP_ROUND_ROUND_TO_NEAREST 0
1245#define FP_ROUND_ROUND_TO_INF 1
1246#define FP_ROUND_ROUND_TO_NEGINF 2
1247#define FP_ROUND_ROUND_TO_ZERO 3
1248
1249// Bits 3:0 control rounding mode. 1:0 control single precision, 3:2 double
1250// precision.
1251#define FP_ROUND_MODE_SP(x) ((x) & 0x3)
1252#define FP_ROUND_MODE_DP(x) (((x) & 0x3) << 2)
1253
1254#define FP_DENORM_FLUSH_IN_FLUSH_OUT 0
1255#define FP_DENORM_FLUSH_OUT 1
1256#define FP_DENORM_FLUSH_IN 2
1257#define FP_DENORM_FLUSH_NONE 3
1258
1259
1260// Bits 7:4 control denormal handling. 5:4 control single precision, 6:7 double
1261// precision.
1262#define FP_DENORM_MODE_SP(x) (((x) & 0x3) << 4)
1263#define FP_DENORM_MODE_DP(x) (((x) & 0x3) << 6)
1264
1265#define R_00B860_COMPUTE_TMPRING_SIZE 0x00B860
1266#define S_00B860_WAVESIZE_PreGFX11(x) (((x) & 0x1FFF) << 12)
1267#define S_00B860_WAVESIZE_GFX11(x) (((x) & 0x7FFF) << 12)
1268#define S_00B860_WAVESIZE_GFX12Plus(x) (((x) & 0x3FFFF) << 12)
1269
1270#define R_0286E8_SPI_TMPRING_SIZE 0x0286E8
1271#define S_0286E8_WAVESIZE_PreGFX11(x) (((x) & 0x1FFF) << 12)
1272#define S_0286E8_WAVESIZE_GFX11(x) (((x) & 0x7FFF) << 12)
1273#define S_0286E8_WAVESIZE_GFX12Plus(x) (((x) & 0x3FFFF) << 12)
1274
1275#define R_028B54_VGT_SHADER_STAGES_EN 0x028B54
1276#define S_028B54_HS_W32_EN(x) (((x) & 0x1) << 21)
1277#define S_028B54_GS_W32_EN(x) (((x) & 0x1) << 22)
1278#define S_028B54_VS_W32_EN(x) (((x) & 0x1) << 23)
1279#define R_0286D8_SPI_PS_IN_CONTROL 0x0286D8
1280#define S_0286D8_PS_W32_EN(x) (((x) & 0x1) << 15)
1281#define R_00B800_COMPUTE_DISPATCH_INITIATOR 0x00B800
1282#define S_00B800_CS_W32_EN(x) (((x) & 0x1) << 15)
1283
1284#define R_SPILLED_SGPRS 0x4
1285#define R_SPILLED_VGPRS 0x8
1286
1287// clang-format on
1288
1289} // End namespace llvm
1290
1291#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:80
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