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"
15
16namespace llvm {
17
18// This needs to be kept in sync with the field bits in SIRegisterClass.
32
34// This must be kept in sync with the SIEncodingFamily class in SIInstrInfo.td
35// and the columns of the getMCOpcodeGen table.
36enum {
37 SI = 0,
38 VI = 1,
39 SDWA = 2,
40 SDWA9 = 3,
41 GFX80 = 4,
42 GFX9 = 5,
43 GFX10 = 6,
44 SDWA10 = 7,
45 GFX90A = 8,
46 GFX940 = 9,
47 GFX11 = 10,
48 GFX1170 = 11,
49 GFX12 = 12,
50 GFX1250 = 13,
51 GFX13 = 14,
52};
53}
54
55namespace SIInstrFlags {
56// This needs to be kept in sync with the field bits in InstSI.
57enum : uint64_t {
58 // Low bits - basic encoding information.
59 SALU = 1 << 0,
60 VALU = 1 << 1,
61
62 // SALU instruction formats.
63 SOP1 = 1 << 2,
64 SOP2 = 1 << 3,
65 SOPC = 1 << 4,
66 SOPK = 1 << 5,
67 SOPP = 1 << 6,
68
69 // VALU instruction formats.
70 VOP1 = 1 << 7,
71 VOP2 = 1 << 8,
72 VOPC = 1 << 9,
73
74 // TODO: Should this be spilt into VOP3 a and b?
75 VOP3 = 1 << 10,
76 VOP3P = 1 << 12,
77
78 VINTRP = 1 << 13,
79 SDWA = 1 << 14,
80 DPP = 1 << 15,
81 TRANS = 1 << 16,
82
83 // Memory instruction formats.
84 MUBUF = 1 << 17,
85 MTBUF = 1 << 18,
86 SMRD = 1 << 19,
87 MIMG = 1 << 20,
88 VIMAGE = 1 << 21,
89 VSAMPLE = 1 << 22,
90 EXP = 1 << 23,
91 FLAT = 1 << 24,
92 DS = 1 << 25,
93
94 // Combined SGPR/VGPR Spill bit
95 // Logic to separate them out is done in isSGPRSpill and isVGPRSpill
96 Spill = 1 << 26,
97
98 // LDSDIR instruction format.
99 LDSDIR = 1 << 28,
100
101 // VINTERP instruction format.
102 VINTERP = 1 << 29,
103
104 VOPD3 = 1 << 30,
105
106 // High bits - other information.
107 VM_CNT = UINT64_C(1) << 32,
108 EXP_CNT = UINT64_C(1) << 33,
109 LGKM_CNT = UINT64_C(1) << 34,
110
111 WQM = UINT64_C(1) << 35,
112 DisableWQM = UINT64_C(1) << 36,
113 Gather4 = UINT64_C(1) << 37,
114
115 TENSOR_CNT = UINT64_C(1) << 38,
116
117 SCALAR_STORE = UINT64_C(1) << 39,
118 FIXED_SIZE = UINT64_C(1) << 40,
119
120 ASYNC_CNT = UINT64_C(1) << 41,
121
122 VOP3_OPSEL = UINT64_C(1) << 42,
123 maybeAtomic = UINT64_C(1) << 43,
124 renamedInGFX9 = UINT64_C(1) << 44,
125
126 // Is a clamp on FP type.
127 FPClamp = UINT64_C(1) << 45,
128
129 // Is an integer clamp
130 IntClamp = UINT64_C(1) << 46,
131
132 // Clamps lo component of register.
133 ClampLo = UINT64_C(1) << 47,
134
135 // Clamps hi component of register.
136 // ClampLo and ClampHi set for packed clamp.
137 ClampHi = UINT64_C(1) << 48,
138
139 // Is a packed VOP3P instruction.
140 IsPacked = UINT64_C(1) << 49,
141
142 // Is a D16 buffer instruction.
143 D16Buf = UINT64_C(1) << 50,
144
145 // FLAT instruction accesses FLAT_GLBL segment.
146 FlatGlobal = UINT64_C(1) << 51,
147
148 // Uses floating point double precision rounding mode
149 FPDPRounding = UINT64_C(1) << 52,
150
151 // Instruction is FP atomic.
152 FPAtomic = UINT64_C(1) << 53,
153
154 // Is a MFMA instruction.
155 IsMAI = UINT64_C(1) << 54,
156
157 // Is a DOT instruction.
158 IsDOT = UINT64_C(1) << 55,
159
160 // FLAT instruction accesses FLAT_SCRATCH segment.
161 FlatScratch = UINT64_C(1) << 56,
162
163 // Atomic without return.
164 IsAtomicNoRet = UINT64_C(1) << 57,
165
166 // Atomic with return.
167 IsAtomicRet = UINT64_C(1) << 58,
168
169 // Is a WMMA instruction.
170 IsWMMA = UINT64_C(1) << 59,
171
172 // Whether tied sources will be read.
173 TiedSourceNotRead = UINT64_C(1) << 60,
174
175 // Is never uniform.
176 IsNeverUniform = UINT64_C(1) << 61,
177
178 // ds_gws_* instructions.
179 GWS = UINT64_C(1) << 62,
180
181 // Is a SWMMAC instruction.
182 IsSWMMAC = UINT64_C(1) << 63,
183};
184
185// v_cmp_class_* etc. use a 10-bit mask for what operation is checked.
186// The result is true if any of these tests are true.
187enum ClassFlags : unsigned {
188 S_NAN = 1 << 0, // Signaling NaN
189 Q_NAN = 1 << 1, // Quiet NaN
190 N_INFINITY = 1 << 2, // Negative infinity
191 N_NORMAL = 1 << 3, // Negative normal
192 N_SUBNORMAL = 1 << 4, // Negative subnormal
193 N_ZERO = 1 << 5, // Negative zero
194 P_ZERO = 1 << 6, // Positive zero
195 P_SUBNORMAL = 1 << 7, // Positive subnormal
196 P_NORMAL = 1 << 8, // Positive normal
197 P_INFINITY = 1 << 9 // Positive infinity
198};
199}
200
201namespace AMDGPU {
202
203enum OperandType : unsigned {
204 /// Operands with register, 32-bit, or 64-bit immediate
221
222 /// Operands with register or inline constant
233
234 // Operand for split barrier inline constant
236
237 /// Operand with 32-bit immediate that uses the constant bus.
241
242 /// Operands with an AccVGPR register or inline constant
246
247 // Operand for AV_MOV_B64_IMM_PSEUDO, which is a pair of 32-bit inline
248 // constants. Does not accept registers.
250
251 // Operand for source modifiers for VOP instructions
253
254 // Operand for SDWA instructions
256
259
262
265
268
271
272};
273}
274
275// Input operand modifiers bit-masks
276// NEG and SEXT share same bit-mask because they can't be set simultaneously.
277namespace SISrcMods {
278enum : unsigned {
279 NONE = 0,
280 NEG = 1 << 0, // Floating-point negate modifier
281 ABS = 1 << 1, // Floating-point absolute modifier
282 SEXT = 1 << 4, // Integer sign-extend modifier
283 NEG_HI = ABS, // Floating-point negate high packed component modifier.
284 OP_SEL_0 = 1 << 2,
285 OP_SEL_1 = 1 << 3,
286 DST_OP_SEL = 1 << 3 // VOP3 dst op_sel (share mask with OP_SEL_1)
287};
288}
289
290namespace SIOutMods {
291 enum : unsigned {
292 NONE = 0,
293 MUL2 = 1,
294 MUL4 = 2,
296 };
297}
298
299namespace AMDGPU {
300namespace VGPRIndexMode {
301
302enum Id : unsigned { // id of symbolic names
307
310};
311
321
322} // namespace VGPRIndexMode
323} // namespace AMDGPU
324
326 enum : unsigned {
328 VOP3 = 1,
329 SDWA = 2,
330 SDWA9 = 3,
331 DPP = 4,
333 };
334} // namespace AMDGPUAsmVariants
335
336namespace AMDGPU {
337namespace EncValues { // Encoding values of enum9/8/7 operands
338
339enum : unsigned {
354 VGPR_MIN = 256,
355 VGPR_MAX = 511,
356 IS_VGPR = 256, // Indicates VGPR or AGPR
357};
358
359} // namespace EncValues
360
361// Register codes as defined in the TableGen's HWEncoding field.
362namespace HWEncoding {
363enum : unsigned {
366 IS_VGPR = 1 << 10,
367 IS_AGPR = 1 << 11,
368 IS_HI16 = 1 << 12,
369};
370} // namespace HWEncoding
371
372namespace CPol {
373
374enum CPol {
375 GLC = 1,
376 SLC = 2,
377 DLC = 4,
378 SCC = 16,
384
385 // Below are GFX12+ cache policy bits
386
387 // Temporal hint
388 TH = 0x7, // All TH bits
389 TH_RT = 0, // regular
390 TH_NT = 1, // non-temporal
391 TH_HT = 2, // high-temporal
392 TH_LU = 3, // last use
393 TH_WB = 3, // regular (CU, SE), high-temporal with write-back (MALL)
394 TH_NT_RT = 4, // non-temporal (CU, SE), regular (MALL)
395 TH_RT_NT = 5, // regular (CU, SE), non-temporal (MALL)
396 TH_NT_HT = 6, // non-temporal (CU, SE), high-temporal (MALL)
397 TH_NT_WB = 7, // non-temporal (CU, SE), high-temporal with write-back (MALL)
398 TH_BYPASS = 3, // only to be used with scope = 3
399
400 TH_RESERVED = 7, // unused value for load insts
401
402 // Bits of TH for atomics
403 TH_ATOMIC_RETURN = GLC, // Returning vs non-returning
404 TH_ATOMIC_NT = SLC, // Non-temporal vs regular
405 TH_ATOMIC_CASCADE = 4, // Cascading vs regular
406
407 // Scope
410 SCOPE = SCOPE_MASK << SCOPE_SHIFT, // All Scope bits
415
416 NV = 1 << 5, // Non-volatile bit
417
418 SWZ = 1 << 6, // Swizzle bit
419
420 SCAL = 1 << 11, // Scale offset bit
421
422 ALL = TH | SCOPE | NV,
423
424 // Helper bits
425 TH_TYPE_LOAD = 1 << 7, // TH_LOAD policy
426 TH_TYPE_STORE = 1 << 8, // TH_STORE policy
427 TH_TYPE_ATOMIC = 1 << 9, // TH_ATOMIC policy
428 TH_REAL_BYPASS = 1 << 10, // is TH=3 bypass policy or not
429
430 // Volatile (used to preserve/signal operation volatility for buffer
431 // operations not a real instruction bit)
432 VOLATILE = 1 << 31,
433 // The set of "cache policy" bits used for compiler features that
434 // do not correspond to handware features.
436};
437
438} // namespace CPol
439
440namespace SendMsg { // Encoding of SIMM16 used in s_sendmsg* insns.
441
442enum Id { // Message ID, width(4) [3:0].
444
445 ID_GS_PreGFX11 = 2, // replaced in GFX11
446 ID_GS_DONE_PreGFX11 = 3, // replaced in GFX11
447
448 ID_HS_TESSFACTOR_GFX11Plus = 2, // reused in GFX11
449 ID_DEALLOC_VGPRS_GFX11Plus = 3, // reused in GFX11
450
451 ID_SAVEWAVE = 4, // added in GFX8, removed in GFX11
452 ID_STALL_WAVE_GEN = 5, // added in GFX9, removed in GFX12
453 ID_HALT_WAVES = 6, // added in GFX9, removed in GFX12
454 ID_ORDERED_PS_DONE = 7, // added in GFX9, removed in GFX11
455 ID_EARLY_PRIM_DEALLOC = 8, // added in GFX9, removed in GFX10
456 ID_GS_ALLOC_REQ = 9, // added in GFX9
457 ID_GET_DOORBELL = 10, // added in GFX9, removed in GFX11
458 ID_GET_DDID = 11, // added in GFX10, removed in GFX11
460
469
470 ID_RTN_GET_CLUSTER_BARRIER_STATE = 136, // added in GFX1250
471 ID_RTN_SAVE_WAVE_HAS_TDM = 152, // added in GFX1250
472
475};
476
477enum Op { // Both GS and SYS operation IDs.
480 // Bits used for operation encoding
482 OP_MASK_ = (((1 << OP_WIDTH_) - 1) << OP_SHIFT_),
483 // GS operations are encoded in bits 5:4
489 // SYS operations are encoded in bits 6:4
495};
496
506
507} // namespace SendMsg
508
509namespace WaitEvent { // Encoding of SIMM16 used in s_wait_event
510enum Id {
511 DONT_WAIT_EXPORT_READY = 1 << 0, // Only used in gfx11
512 EXPORT_READY = 1 << 1, // gfx12+
513};
514
515} // namespace WaitEvent
516
517namespace Hwreg { // Encoding of SIMM16 used in s_setreg/getreg* insns.
518
572
573enum Offset : unsigned { // Offset, (5) [10:6]
575 OFFSET_ME_ID = 8, // in HW_ID2
576};
577
579 FP_ROUND_MASK = 0xf << 0, // Bits 0..3
580 FP_DENORM_MASK = 0xf << 4, // Bits 4..7
583 LOD_CLAMP_MASK = 1 << 10,
584 DEBUG_MASK = 1 << 11,
585
586 // EXCP_EN fields.
594
596 VSKIP_MASK = 1 << 28,
597 CSP_MASK = 0x7u << 29, // Bits 29..31
598
599 // GFX1250
600 DST_VGPR_MSB = 0x3 << 12,
601 SRC0_VGPR_MSB = 0x3 << 14,
602 SRC1_VGPR_MSB = 0x3 << 16,
603 SRC2_VGPR_MSB = 0x3 << 18,
604 VGPR_MSB_MASK = 0xff << 12, // Bits 12..19
605
606 REPLAY_MODE = 1 << 25,
608};
609
610} // namespace Hwreg
611
681
682namespace UfmtGFX10 {
683enum UnifiedFormat : int64_t {
685
692
700
707
711
719
727
735
742
749
756
760
768
775
778};
779
780} // namespace UfmtGFX10
781
782namespace UfmtGFX11 {
783enum UnifiedFormat : int64_t {
785
792
800
807
811
819
821
823
828
835
842
846
854
861
864};
865
866} // namespace UfmtGFX11
867
868namespace Swizzle { // Encoding of swizzle macro used in ds_swizzle_b32.
869
879
880// clang-format off
881enum EncBits : unsigned {
882
883 // swizzle mode encodings
884
887
890
891 FFT_MODE_ENC = 0xE000,
892
895
897 FFT_MODE_LO = 0xE000,
898
899 // QUAD_PERM encodings
900
905
906 // BITMASK_PERM encodings
907
911
915
916 // FFT encodings
917
920
921 // ROTATE encodings
923 ROTATE_DIR_SHIFT = 10, // bit position of rotate direction
925 ROTATE_SIZE_SHIFT = 5, // bit position of rotate size
927};
928// clang-format on
929
930} // namespace Swizzle
931
932namespace SDWA {
933
934enum SdwaSel : unsigned {
941 DWORD = 6,
942};
943
944enum DstUnused : unsigned {
948};
949
964
965} // namespace SDWA
966
967namespace DPP {
968
969// clang-format off
1014// clang-format on
1015
1022
1023} // namespace DPP
1024
1025namespace Exp {
1026
1027enum Target : unsigned {
1031 ET_NULL = 9, // Pre-GFX11
1034 ET_POS4 = 16, // GFX10+
1035 ET_POS_LAST = ET_POS4, // Highest pos used on any subtarget
1036 ET_PRIM = 20, // GFX10+
1037 ET_DUAL_SRC_BLEND0 = 21, // GFX11+
1038 ET_DUAL_SRC_BLEND1 = 22, // GFX11+
1039 ET_PARAM0 = 32, // Pre-GFX11
1040 ET_PARAM31 = 63, // Pre-GFX11
1041
1049
1051};
1052
1053} // namespace Exp
1054
1075
1076namespace VOP3PEncoding {
1077
1079 OP_SEL_HI_0 = UINT64_C(1) << 59,
1080 OP_SEL_HI_1 = UINT64_C(1) << 60,
1081 OP_SEL_HI_2 = UINT64_C(1) << 14,
1082};
1083
1084} // namespace VOP3PEncoding
1085
1086namespace ImplicitArg {
1087// Implicit kernel argument offset for code object version 5.
1100
1101} // namespace ImplicitArg
1102
1104// Enum value used in cbsz/blgp for F8F6F4 MFMA operations to select the matrix
1105// format.
1113} // namespace MFMAScaleFormats
1114
1115namespace VirtRegFlag {
1116// Virtual register flags used for various target specific handlings during
1117// codegen.
1119 // Register operand in a whole-wave mode operation.
1120 WWM_REG = 1 << 0,
1121};
1122
1123} // namespace VirtRegFlag
1124
1125} // namespace AMDGPU
1126
1127namespace AMDGPU {
1128namespace Barrier {
1129
1138
1139enum {
1141};
1142
1143} // namespace Barrier
1144} // namespace AMDGPU
1145
1146// clang-format off
1147
1148#define R_00B028_SPI_SHADER_PGM_RSRC1_PS 0x00B028
1149#define S_00B028_VGPRS(x) (((x) & 0x3F) << 0)
1150#define S_00B028_SGPRS(x) (((x) & 0x0F) << 6)
1151#define S_00B028_MEM_ORDERED(x) (((x) & 0x1) << 25)
1152#define G_00B028_MEM_ORDERED(x) (((x) >> 25) & 0x1)
1153#define C_00B028_MEM_ORDERED 0xFDFFFFFF
1154
1155#define R_00B02C_SPI_SHADER_PGM_RSRC2_PS 0x00B02C
1156#define S_00B02C_EXTRA_LDS_SIZE(x) (((x) & 0xFF) << 8)
1157#define R_00B128_SPI_SHADER_PGM_RSRC1_VS 0x00B128
1158#define S_00B128_MEM_ORDERED(x) (((x) & 0x1) << 27)
1159#define G_00B128_MEM_ORDERED(x) (((x) >> 27) & 0x1)
1160#define C_00B128_MEM_ORDERED 0xF7FFFFFF
1161
1162#define R_00B228_SPI_SHADER_PGM_RSRC1_GS 0x00B228
1163#define S_00B228_WGP_MODE(x) (((x) & 0x1) << 27)
1164#define G_00B228_WGP_MODE(x) (((x) >> 27) & 0x1)
1165#define C_00B228_WGP_MODE 0xF7FFFFFF
1166#define S_00B228_MEM_ORDERED(x) (((x) & 0x1) << 25)
1167#define G_00B228_MEM_ORDERED(x) (((x) >> 25) & 0x1)
1168#define C_00B228_MEM_ORDERED 0xFDFFFFFF
1169
1170#define R_00B328_SPI_SHADER_PGM_RSRC1_ES 0x00B328
1171#define R_00B428_SPI_SHADER_PGM_RSRC1_HS 0x00B428
1172#define S_00B428_WGP_MODE(x) (((x) & 0x1) << 26)
1173#define G_00B428_WGP_MODE(x) (((x) >> 26) & 0x1)
1174#define C_00B428_WGP_MODE 0xFBFFFFFF
1175#define S_00B428_MEM_ORDERED(x) (((x) & 0x1) << 24)
1176#define G_00B428_MEM_ORDERED(x) (((x) >> 24) & 0x1)
1177#define C_00B428_MEM_ORDERED 0xFEFFFFFF
1178
1179#define R_00B528_SPI_SHADER_PGM_RSRC1_LS 0x00B528
1180
1181#define R_00B84C_COMPUTE_PGM_RSRC2 0x00B84C
1182#define S_00B84C_SCRATCH_EN(x) (((x) & 0x1) << 0)
1183#define G_00B84C_SCRATCH_EN(x) (((x) >> 0) & 0x1)
1184#define C_00B84C_SCRATCH_EN 0xFFFFFFFE
1185#define S_00B84C_USER_SGPR(x) (((x) & 0x1F) << 1)
1186#define G_00B84C_USER_SGPR(x) (((x) >> 1) & 0x1F)
1187#define C_00B84C_USER_SGPR 0xFFFFFFC1
1188#define S_00B84C_TRAP_HANDLER(x) (((x) & 0x1) << 6)
1189#define G_00B84C_TRAP_HANDLER(x) (((x) >> 6) & 0x1)
1190#define C_00B84C_TRAP_HANDLER 0xFFFFFFBF
1191#define S_00B84C_TGID_X_EN(x) (((x) & 0x1) << 7)
1192#define G_00B84C_TGID_X_EN(x) (((x) >> 7) & 0x1)
1193#define C_00B84C_TGID_X_EN 0xFFFFFF7F
1194#define S_00B84C_TGID_Y_EN(x) (((x) & 0x1) << 8)
1195#define G_00B84C_TGID_Y_EN(x) (((x) >> 8) & 0x1)
1196#define C_00B84C_TGID_Y_EN 0xFFFFFEFF
1197#define S_00B84C_TGID_Z_EN(x) (((x) & 0x1) << 9)
1198#define G_00B84C_TGID_Z_EN(x) (((x) >> 9) & 0x1)
1199#define C_00B84C_TGID_Z_EN 0xFFFFFDFF
1200#define S_00B84C_TG_SIZE_EN(x) (((x) & 0x1) << 10)
1201#define G_00B84C_TG_SIZE_EN(x) (((x) >> 10) & 0x1)
1202#define C_00B84C_TG_SIZE_EN 0xFFFFFBFF
1203#define S_00B84C_TIDIG_COMP_CNT(x) (((x) & 0x03) << 11)
1204#define G_00B84C_TIDIG_COMP_CNT(x) (((x) >> 11) & 0x03)
1205#define C_00B84C_TIDIG_COMP_CNT 0xFFFFE7FF
1206/* CIK */
1207#define S_00B84C_EXCP_EN_MSB(x) (((x) & 0x03) << 13)
1208#define G_00B84C_EXCP_EN_MSB(x) (((x) >> 13) & 0x03)
1209#define C_00B84C_EXCP_EN_MSB 0xFFFF9FFF
1210/* */
1211#define S_00B84C_LDS_SIZE(x) (((x) & 0x1FF) << 15)
1212#define G_00B84C_LDS_SIZE(x) (((x) >> 15) & 0x1FF)
1213#define C_00B84C_LDS_SIZE 0xFF007FFF
1214#define S_00B84C_EXCP_EN(x) (((x) & 0x7F) << 24)
1215#define G_00B84C_EXCP_EN(x) (((x) >> 24) & 0x7F)
1216#define C_00B84C_EXCP_EN 0x80FFFFFF
1217
1218#define S_00B84C_USER_SGPR_GFX1250(x) (((x) & 0x3F) << 1)
1219#define G_00B84C_USER_SGPR_GFX1250(x) (((x) >> 1) & 0x3F)
1220#define C_00B84C_USER_SGPR_GFX1250 0xFFFFFF81
1221
1222#define R_0286CC_SPI_PS_INPUT_ENA 0x0286CC
1223#define R_0286D0_SPI_PS_INPUT_ADDR 0x0286D0
1224
1225#define R_00B848_COMPUTE_PGM_RSRC1 0x00B848
1226#define S_00B848_VGPRS(x) (((x) & 0x3F) << 0)
1227#define G_00B848_VGPRS(x) (((x) >> 0) & 0x3F)
1228#define C_00B848_VGPRS 0xFFFFFFC0
1229#define S_00B848_SGPRS(x) (((x) & 0x0F) << 6)
1230#define G_00B848_SGPRS(x) (((x) >> 6) & 0x0F)
1231#define C_00B848_SGPRS 0xFFFFFC3F
1232#define S_00B848_PRIORITY(x) (((x) & 0x03) << 10)
1233#define G_00B848_PRIORITY(x) (((x) >> 10) & 0x03)
1234#define C_00B848_PRIORITY 0xFFFFF3FF
1235#define S_00B848_FLOAT_MODE(x) (((x) & 0xFF) << 12)
1236#define G_00B848_FLOAT_MODE(x) (((x) >> 12) & 0xFF)
1237#define C_00B848_FLOAT_MODE 0xFFF00FFF
1238#define S_00B848_PRIV(x) (((x) & 0x1) << 20)
1239#define G_00B848_PRIV(x) (((x) >> 20) & 0x1)
1240#define C_00B848_PRIV 0xFFEFFFFF
1241#define S_00B848_DX10_CLAMP(x) (((x) & 0x1) << 21)
1242#define G_00B848_DX10_CLAMP(x) (((x) >> 21) & 0x1)
1243#define C_00B848_DX10_CLAMP 0xFFDFFFFF
1244#define S_00B848_RR_WG_MODE(x) (((x) & 0x1) << 21)
1245#define G_00B848_RR_WG_MODE(x) (((x) >> 21) & 0x1)
1246#define C_00B848_RR_WG_MODE 0xFFDFFFFF
1247#define S_00B848_DEBUG_MODE(x) (((x) & 0x1) << 22)
1248#define G_00B848_DEBUG_MODE(x) (((x) >> 22) & 0x1)
1249#define C_00B848_DEBUG_MODE 0xFFBFFFFF
1250#define S_00B848_IEEE_MODE(x) (((x) & 0x1) << 23)
1251#define G_00B848_IEEE_MODE(x) (((x) >> 23) & 0x1)
1252#define C_00B848_IEEE_MODE 0xFF7FFFFF
1253#define S_00B848_WGP_MODE(x) (((x) & 0x1) << 29)
1254#define G_00B848_WGP_MODE(x) (((x) >> 29) & 0x1)
1255#define C_00B848_WGP_MODE 0xDFFFFFFF
1256#define S_00B848_MEM_ORDERED(x) (((x) & 0x1) << 30)
1257#define G_00B848_MEM_ORDERED(x) (((x) >> 30) & 0x1)
1258#define C_00B848_MEM_ORDERED 0xBFFFFFFF
1259#define S_00B848_FWD_PROGRESS(x) (((x) & 0x1) << 31)
1260#define G_00B848_FWD_PROGRESS(x) (((x) >> 31) & 0x1)
1261#define C_00B848_FWD_PROGRESS 0x7FFFFFFF
1262
1263// Helpers for setting FLOAT_MODE
1264#define FP_ROUND_ROUND_TO_NEAREST 0
1265#define FP_ROUND_ROUND_TO_INF 1
1266#define FP_ROUND_ROUND_TO_NEGINF 2
1267#define FP_ROUND_ROUND_TO_ZERO 3
1268
1269// Bits 3:0 control rounding mode. 1:0 control single precision, 3:2 double
1270// precision.
1271#define FP_ROUND_MODE_SP(x) ((x) & 0x3)
1272#define FP_ROUND_MODE_DP(x) (((x) & 0x3) << 2)
1273
1274#define FP_DENORM_FLUSH_IN_FLUSH_OUT 0
1275#define FP_DENORM_FLUSH_OUT 1
1276#define FP_DENORM_FLUSH_IN 2
1277#define FP_DENORM_FLUSH_NONE 3
1278
1279
1280// Bits 7:4 control denormal handling. 5:4 control single precision, 6:7 double
1281// precision.
1282#define FP_DENORM_MODE_SP(x) (((x) & 0x3) << 4)
1283#define FP_DENORM_MODE_DP(x) (((x) & 0x3) << 6)
1284
1285#define R_00B860_COMPUTE_TMPRING_SIZE 0x00B860
1286#define S_00B860_WAVESIZE_PreGFX11(x) (((x) & 0x1FFF) << 12)
1287#define S_00B860_WAVESIZE_GFX11(x) (((x) & 0x7FFF) << 12)
1288#define S_00B860_WAVESIZE_GFX12Plus(x) (((x) & 0x3FFFF) << 12)
1289
1290#define R_0286E8_SPI_TMPRING_SIZE 0x0286E8
1291#define S_0286E8_WAVESIZE_PreGFX11(x) (((x) & 0x1FFF) << 12)
1292#define S_0286E8_WAVESIZE_GFX11(x) (((x) & 0x7FFF) << 12)
1293#define S_0286E8_WAVESIZE_GFX12Plus(x) (((x) & 0x3FFFF) << 12)
1294
1295#define R_028B54_VGT_SHADER_STAGES_EN 0x028B54
1296#define S_028B54_HS_W32_EN(x) (((x) & 0x1) << 21)
1297#define S_028B54_GS_W32_EN(x) (((x) & 0x1) << 22)
1298#define S_028B54_VS_W32_EN(x) (((x) & 0x1) << 23)
1299#define R_0286D8_SPI_PS_IN_CONTROL 0x0286D8
1300#define S_0286D8_PS_W32_EN(x) (((x) & 0x1) << 15)
1301#define R_00B800_COMPUTE_DISPATCH_INITIATOR 0x00B800
1302#define S_00B800_CS_W32_EN(x) (((x) & 0x1) << 15)
1303
1304#define R_SPILLED_SGPRS 0x4
1305#define R_SPILLED_VGPRS 0x8
1306
1307// clang-format on
1308
1309} // End namespace llvm
1310
1311#endif
AMDGPU address space definition.
@ OPERAND_REG_IMM_V2FP64
Definition SIDefines.h:220
@ OPERAND_KIMM32
Operand with 32-bit immediate that uses the constant bus.
Definition SIDefines.h:238
@ OPERAND_REG_INLINE_C_LAST
Definition SIDefines.h:261
@ OPERAND_REG_IMM_INT64
Definition SIDefines.h:206
@ OPERAND_REG_IMM_V2FP16
Definition SIDefines.h:213
@ OPERAND_REG_INLINE_C_FP64
Definition SIDefines.h:229
@ OPERAND_REG_INLINE_C_BF16
Definition SIDefines.h:226
@ OPERAND_REG_IMM_FIRST
Definition SIDefines.h:257
@ OPERAND_REG_INLINE_C_V2BF16
Definition SIDefines.h:231
@ OPERAND_REG_IMM_V2INT64
Definition SIDefines.h:216
@ OPERAND_REG_IMM_V2INT16
Definition SIDefines.h:215
@ OPERAND_REG_IMM_BF16
Definition SIDefines.h:210
@ OPERAND_REG_IMM_INT32
Operands with register, 32-bit, or 64-bit immediate.
Definition SIDefines.h:205
@ OPERAND_REG_IMM_V2BF16
Definition SIDefines.h:212
@ OPERAND_REG_INLINE_AC_FIRST
Definition SIDefines.h:263
@ OPERAND_REG_IMM_FP16
Definition SIDefines.h:211
@ OPERAND_REG_IMM_V2FP16_SPLAT
Definition SIDefines.h:214
@ OPERAND_REG_INLINE_C_INT64
Definition SIDefines.h:225
@ OPERAND_REG_INLINE_C_INT16
Operands with register or inline constant.
Definition SIDefines.h:223
@ OPERAND_REG_IMM_NOINLINE_V2FP16
Definition SIDefines.h:217
@ OPERAND_REG_IMM_FP64
Definition SIDefines.h:209
@ OPERAND_REG_INLINE_C_V2FP16
Definition SIDefines.h:232
@ OPERAND_REG_INLINE_AC_INT32
Operands with an AccVGPR register or inline constant.
Definition SIDefines.h:243
@ OPERAND_REG_INLINE_AC_FP32
Definition SIDefines.h:244
@ OPERAND_REG_IMM_V2INT32
Definition SIDefines.h:218
@ OPERAND_SDWA_VOPC_DST
Definition SIDefines.h:255
@ OPERAND_REG_IMM_FP32
Definition SIDefines.h:208
@ OPERAND_REG_INLINE_C_FIRST
Definition SIDefines.h:260
@ OPERAND_REG_INLINE_C_FP32
Definition SIDefines.h:228
@ OPERAND_REG_INLINE_AC_LAST
Definition SIDefines.h:264
@ OPERAND_REG_IMM_LAST
Definition SIDefines.h:258
@ OPERAND_REG_INLINE_C_INT32
Definition SIDefines.h:224
@ OPERAND_REG_INLINE_C_V2INT16
Definition SIDefines.h:230
@ OPERAND_INLINE_C_AV64_PSEUDO
Definition SIDefines.h:249
@ OPERAND_REG_IMM_V2FP32
Definition SIDefines.h:219
@ OPERAND_REG_INLINE_AC_FP64
Definition SIDefines.h:245
@ OPERAND_REG_INLINE_C_FP16
Definition SIDefines.h:227
@ OPERAND_REG_IMM_INT16
Definition SIDefines.h:207
@ OPERAND_INLINE_SPLIT_BARRIER_INT32
Definition SIDefines.h:235
@ OPERAND_FIRST_TARGET
Definition MCInstrDesc.h:79
This is an optimization pass for GlobalISel generic memory operations.
SIRCFlags
Definition SIDefines.h:19
@ HasSGPR
Definition SIDefines.h:27
@ HasAGPRBit
Definition SIDefines.h:22
@ HasSGPRbit
Definition SIDefines.h:23
@ RegTupleAlignUnitsWidth
Definition SIDefines.h:20
@ RegTupleAlignUnitsMask
Definition SIDefines.h:29
@ HasVGPRBit
Definition SIDefines.h:21
@ HasVGPR
Definition SIDefines.h:25
@ RegKindMask
Definition SIDefines.h:30
@ HasAGPR
Definition SIDefines.h:26