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
219
220 /// Operands with register or inline constant
231
232 // Operand for split barrier inline constant
234
235 /// Operand with 32-bit immediate that uses the constant bus.
239
240 /// Operands with an AccVGPR register or inline constant
244
245 // Operand for AV_MOV_B64_IMM_PSEUDO, which is a pair of 32-bit inline
246 // constants. Does not accept registers.
248
249 // Operand for source modifiers for VOP instructions
251
252 // Operand for SDWA instructions
254
257
260
263
266
269
270};
271}
272
273// Input operand modifiers bit-masks
274// NEG and SEXT share same bit-mask because they can't be set simultaneously.
275namespace SISrcMods {
276enum : unsigned {
277 NONE = 0,
278 NEG = 1 << 0, // Floating-point negate modifier
279 ABS = 1 << 1, // Floating-point absolute modifier
280 SEXT = 1 << 4, // Integer sign-extend modifier
281 NEG_HI = ABS, // Floating-point negate high packed component modifier.
282 OP_SEL_0 = 1 << 2,
283 OP_SEL_1 = 1 << 3,
284 DST_OP_SEL = 1 << 3 // VOP3 dst op_sel (share mask with OP_SEL_1)
285};
286}
287
288namespace SIOutMods {
289 enum : unsigned {
290 NONE = 0,
291 MUL2 = 1,
292 MUL4 = 2,
294 };
295}
296
297namespace AMDGPU {
298namespace VGPRIndexMode {
299
300enum Id : unsigned { // id of symbolic names
305
308};
309
319
320} // namespace VGPRIndexMode
321} // namespace AMDGPU
322
324 enum : unsigned {
326 VOP3 = 1,
327 SDWA = 2,
328 SDWA9 = 3,
329 DPP = 4,
331 };
332} // namespace AMDGPUAsmVariants
333
334namespace AMDGPU {
335namespace EncValues { // Encoding values of enum9/8/7 operands
336
337enum : unsigned {
352 VGPR_MIN = 256,
353 VGPR_MAX = 511,
354 IS_VGPR = 256, // Indicates VGPR or AGPR
355};
356
357} // namespace EncValues
358
359// Register codes as defined in the TableGen's HWEncoding field.
360namespace HWEncoding {
361enum : unsigned {
364 IS_VGPR = 1 << 10,
365 IS_AGPR = 1 << 11,
366 IS_HI16 = 1 << 12,
367};
368} // namespace HWEncoding
369
370namespace CPol {
371
372enum CPol {
373 GLC = 1,
374 SLC = 2,
375 DLC = 4,
376 SCC = 16,
382
383 // Below are GFX12+ cache policy bits
384
385 // Temporal hint
386 TH = 0x7, // All TH bits
387 TH_RT = 0, // regular
388 TH_NT = 1, // non-temporal
389 TH_HT = 2, // high-temporal
390 TH_LU = 3, // last use
391 TH_WB = 3, // regular (CU, SE), high-temporal with write-back (MALL)
392 TH_NT_RT = 4, // non-temporal (CU, SE), regular (MALL)
393 TH_RT_NT = 5, // regular (CU, SE), non-temporal (MALL)
394 TH_NT_HT = 6, // non-temporal (CU, SE), high-temporal (MALL)
395 TH_NT_WB = 7, // non-temporal (CU, SE), high-temporal with write-back (MALL)
396 TH_BYPASS = 3, // only to be used with scope = 3
397
398 TH_RESERVED = 7, // unused value for load insts
399
400 // Bits of TH for atomics
401 TH_ATOMIC_RETURN = GLC, // Returning vs non-returning
402 TH_ATOMIC_NT = SLC, // Non-temporal vs regular
403 TH_ATOMIC_CASCADE = 4, // Cascading vs regular
404
405 // Scope
408 SCOPE = SCOPE_MASK << SCOPE_SHIFT, // All Scope bits
413
414 NV = 1 << 5, // Non-volatile bit
415
416 SWZ = 1 << 6, // Swizzle bit
417
418 SCAL = 1 << 11, // Scale offset bit
419
420 ALL = TH | SCOPE | NV,
421
422 // Helper bits
423 TH_TYPE_LOAD = 1 << 7, // TH_LOAD policy
424 TH_TYPE_STORE = 1 << 8, // TH_STORE policy
425 TH_TYPE_ATOMIC = 1 << 9, // TH_ATOMIC policy
426 TH_REAL_BYPASS = 1 << 10, // is TH=3 bypass policy or not
427
428 // Volatile (used to preserve/signal operation volatility for buffer
429 // operations not a real instruction bit)
430 VOLATILE = 1 << 31,
431 // The set of "cache policy" bits used for compiler features that
432 // do not correspond to handware features.
434};
435
436} // namespace CPol
437
438namespace SendMsg { // Encoding of SIMM16 used in s_sendmsg* insns.
439
440enum Id { // Message ID, width(4) [3:0].
442
443 ID_GS_PreGFX11 = 2, // replaced in GFX11
444 ID_GS_DONE_PreGFX11 = 3, // replaced in GFX11
445
446 ID_HS_TESSFACTOR_GFX11Plus = 2, // reused in GFX11
447 ID_DEALLOC_VGPRS_GFX11Plus = 3, // reused in GFX11
448
449 ID_SAVEWAVE = 4, // added in GFX8, removed in GFX11
450 ID_STALL_WAVE_GEN = 5, // added in GFX9, removed in GFX12
451 ID_HALT_WAVES = 6, // added in GFX9, removed in GFX12
452 ID_ORDERED_PS_DONE = 7, // added in GFX9, removed in GFX11
453 ID_EARLY_PRIM_DEALLOC = 8, // added in GFX9, removed in GFX10
454 ID_GS_ALLOC_REQ = 9, // added in GFX9
455 ID_GET_DOORBELL = 10, // added in GFX9, removed in GFX11
456 ID_GET_DDID = 11, // added in GFX10, removed in GFX11
458
467
468 ID_RTN_GET_CLUSTER_BARRIER_STATE = 136, // added in GFX1250
469 ID_RTN_SAVE_WAVE_HAS_TDM = 152, // added in GFX1250
470
473};
474
475enum Op { // Both GS and SYS operation IDs.
478 // Bits used for operation encoding
480 OP_MASK_ = (((1 << OP_WIDTH_) - 1) << OP_SHIFT_),
481 // GS operations are encoded in bits 5:4
487 // SYS operations are encoded in bits 6:4
493};
494
504
505} // namespace SendMsg
506
507namespace WaitEvent { // Encoding of SIMM16 used in s_wait_event
508enum Id {
509 DONT_WAIT_EXPORT_READY = 1 << 0, // Only used in gfx11
510 EXPORT_READY = 1 << 1, // gfx12+
511};
512
513} // namespace WaitEvent
514
515namespace Hwreg { // Encoding of SIMM16 used in s_setreg/getreg* insns.
516
570
571enum Offset : unsigned { // Offset, (5) [10:6]
573 OFFSET_ME_ID = 8, // in HW_ID2
574};
575
577 FP_ROUND_MASK = 0xf << 0, // Bits 0..3
578 FP_DENORM_MASK = 0xf << 4, // Bits 4..7
581 LOD_CLAMP_MASK = 1 << 10,
582 DEBUG_MASK = 1 << 11,
583
584 // EXCP_EN fields.
592
594 VSKIP_MASK = 1 << 28,
595 CSP_MASK = 0x7u << 29, // Bits 29..31
596
597 // GFX1250
598 DST_VGPR_MSB = 0x3 << 12,
599 SRC0_VGPR_MSB = 0x3 << 14,
600 SRC1_VGPR_MSB = 0x3 << 16,
601 SRC2_VGPR_MSB = 0x3 << 18,
602 VGPR_MSB_MASK = 0xff << 12, // Bits 12..19
603
604 REPLAY_MODE = 1 << 25,
606};
607
608} // namespace Hwreg
609
679
680namespace UfmtGFX10 {
681enum UnifiedFormat : int64_t {
683
690
698
705
709
717
725
733
740
747
754
758
766
773
776};
777
778} // namespace UfmtGFX10
779
780namespace UfmtGFX11 {
781enum UnifiedFormat : int64_t {
783
790
798
805
809
817
819
821
826
833
840
844
852
859
862};
863
864} // namespace UfmtGFX11
865
866namespace Swizzle { // Encoding of swizzle macro used in ds_swizzle_b32.
867
877
878// clang-format off
879enum EncBits : unsigned {
880
881 // swizzle mode encodings
882
885
888
889 FFT_MODE_ENC = 0xE000,
890
893
895 FFT_MODE_LO = 0xE000,
896
897 // QUAD_PERM encodings
898
903
904 // BITMASK_PERM encodings
905
909
913
914 // FFT encodings
915
918
919 // ROTATE encodings
921 ROTATE_DIR_SHIFT = 10, // bit position of rotate direction
923 ROTATE_SIZE_SHIFT = 5, // bit position of rotate size
925};
926// clang-format on
927
928} // namespace Swizzle
929
930namespace SDWA {
931
932enum SdwaSel : unsigned {
939 DWORD = 6,
940};
941
942enum DstUnused : unsigned {
946};
947
962
963} // namespace SDWA
964
965namespace DPP {
966
967// clang-format off
1012// clang-format on
1013
1020
1021} // namespace DPP
1022
1023namespace Exp {
1024
1025enum Target : unsigned {
1029 ET_NULL = 9, // Pre-GFX11
1032 ET_POS4 = 16, // GFX10+
1033 ET_POS_LAST = ET_POS4, // Highest pos used on any subtarget
1034 ET_PRIM = 20, // GFX10+
1035 ET_DUAL_SRC_BLEND0 = 21, // GFX11+
1036 ET_DUAL_SRC_BLEND1 = 22, // GFX11+
1037 ET_PARAM0 = 32, // Pre-GFX11
1038 ET_PARAM31 = 63, // Pre-GFX11
1039
1047
1049};
1050
1051} // namespace Exp
1052
1073
1074namespace VOP3PEncoding {
1075
1077 OP_SEL_HI_0 = UINT64_C(1) << 59,
1078 OP_SEL_HI_1 = UINT64_C(1) << 60,
1079 OP_SEL_HI_2 = UINT64_C(1) << 14,
1080};
1081
1082} // namespace VOP3PEncoding
1083
1084namespace ImplicitArg {
1085// Implicit kernel argument offset for code object version 5.
1098
1099} // namespace ImplicitArg
1100
1102// Enum value used in cbsz/blgp for F8F6F4 MFMA operations to select the matrix
1103// format.
1111} // namespace MFMAScaleFormats
1112
1113namespace VirtRegFlag {
1114// Virtual register flags used for various target specific handlings during
1115// codegen.
1117 // Register operand in a whole-wave mode operation.
1118 WWM_REG = 1 << 0,
1119};
1120
1121} // namespace VirtRegFlag
1122
1123} // namespace AMDGPU
1124
1125namespace AMDGPU {
1126namespace Barrier {
1127
1136
1137enum {
1139};
1140
1141} // namespace Barrier
1142} // namespace AMDGPU
1143
1144// clang-format off
1145
1146#define R_00B028_SPI_SHADER_PGM_RSRC1_PS 0x00B028
1147#define S_00B028_VGPRS(x) (((x) & 0x3F) << 0)
1148#define S_00B028_SGPRS(x) (((x) & 0x0F) << 6)
1149#define S_00B028_MEM_ORDERED(x) (((x) & 0x1) << 25)
1150#define G_00B028_MEM_ORDERED(x) (((x) >> 25) & 0x1)
1151#define C_00B028_MEM_ORDERED 0xFDFFFFFF
1152
1153#define R_00B02C_SPI_SHADER_PGM_RSRC2_PS 0x00B02C
1154#define S_00B02C_EXTRA_LDS_SIZE(x) (((x) & 0xFF) << 8)
1155#define R_00B128_SPI_SHADER_PGM_RSRC1_VS 0x00B128
1156#define S_00B128_MEM_ORDERED(x) (((x) & 0x1) << 27)
1157#define G_00B128_MEM_ORDERED(x) (((x) >> 27) & 0x1)
1158#define C_00B128_MEM_ORDERED 0xF7FFFFFF
1159
1160#define R_00B228_SPI_SHADER_PGM_RSRC1_GS 0x00B228
1161#define S_00B228_WGP_MODE(x) (((x) & 0x1) << 27)
1162#define G_00B228_WGP_MODE(x) (((x) >> 27) & 0x1)
1163#define C_00B228_WGP_MODE 0xF7FFFFFF
1164#define S_00B228_MEM_ORDERED(x) (((x) & 0x1) << 25)
1165#define G_00B228_MEM_ORDERED(x) (((x) >> 25) & 0x1)
1166#define C_00B228_MEM_ORDERED 0xFDFFFFFF
1167
1168#define R_00B328_SPI_SHADER_PGM_RSRC1_ES 0x00B328
1169#define R_00B428_SPI_SHADER_PGM_RSRC1_HS 0x00B428
1170#define S_00B428_WGP_MODE(x) (((x) & 0x1) << 26)
1171#define G_00B428_WGP_MODE(x) (((x) >> 26) & 0x1)
1172#define C_00B428_WGP_MODE 0xFBFFFFFF
1173#define S_00B428_MEM_ORDERED(x) (((x) & 0x1) << 24)
1174#define G_00B428_MEM_ORDERED(x) (((x) >> 24) & 0x1)
1175#define C_00B428_MEM_ORDERED 0xFEFFFFFF
1176
1177#define R_00B528_SPI_SHADER_PGM_RSRC1_LS 0x00B528
1178
1179#define R_00B84C_COMPUTE_PGM_RSRC2 0x00B84C
1180#define S_00B84C_SCRATCH_EN(x) (((x) & 0x1) << 0)
1181#define G_00B84C_SCRATCH_EN(x) (((x) >> 0) & 0x1)
1182#define C_00B84C_SCRATCH_EN 0xFFFFFFFE
1183#define S_00B84C_USER_SGPR(x) (((x) & 0x1F) << 1)
1184#define G_00B84C_USER_SGPR(x) (((x) >> 1) & 0x1F)
1185#define C_00B84C_USER_SGPR 0xFFFFFFC1
1186#define S_00B84C_TRAP_HANDLER(x) (((x) & 0x1) << 6)
1187#define G_00B84C_TRAP_HANDLER(x) (((x) >> 6) & 0x1)
1188#define C_00B84C_TRAP_HANDLER 0xFFFFFFBF
1189#define S_00B84C_TGID_X_EN(x) (((x) & 0x1) << 7)
1190#define G_00B84C_TGID_X_EN(x) (((x) >> 7) & 0x1)
1191#define C_00B84C_TGID_X_EN 0xFFFFFF7F
1192#define S_00B84C_TGID_Y_EN(x) (((x) & 0x1) << 8)
1193#define G_00B84C_TGID_Y_EN(x) (((x) >> 8) & 0x1)
1194#define C_00B84C_TGID_Y_EN 0xFFFFFEFF
1195#define S_00B84C_TGID_Z_EN(x) (((x) & 0x1) << 9)
1196#define G_00B84C_TGID_Z_EN(x) (((x) >> 9) & 0x1)
1197#define C_00B84C_TGID_Z_EN 0xFFFFFDFF
1198#define S_00B84C_TG_SIZE_EN(x) (((x) & 0x1) << 10)
1199#define G_00B84C_TG_SIZE_EN(x) (((x) >> 10) & 0x1)
1200#define C_00B84C_TG_SIZE_EN 0xFFFFFBFF
1201#define S_00B84C_TIDIG_COMP_CNT(x) (((x) & 0x03) << 11)
1202#define G_00B84C_TIDIG_COMP_CNT(x) (((x) >> 11) & 0x03)
1203#define C_00B84C_TIDIG_COMP_CNT 0xFFFFE7FF
1204/* CIK */
1205#define S_00B84C_EXCP_EN_MSB(x) (((x) & 0x03) << 13)
1206#define G_00B84C_EXCP_EN_MSB(x) (((x) >> 13) & 0x03)
1207#define C_00B84C_EXCP_EN_MSB 0xFFFF9FFF
1208/* */
1209#define S_00B84C_LDS_SIZE(x) (((x) & 0x1FF) << 15)
1210#define G_00B84C_LDS_SIZE(x) (((x) >> 15) & 0x1FF)
1211#define C_00B84C_LDS_SIZE 0xFF007FFF
1212#define S_00B84C_EXCP_EN(x) (((x) & 0x7F) << 24)
1213#define G_00B84C_EXCP_EN(x) (((x) >> 24) & 0x7F)
1214#define C_00B84C_EXCP_EN 0x80FFFFFF
1215
1216#define S_00B84C_USER_SGPR_GFX1250(x) (((x) & 0x3F) << 1)
1217#define G_00B84C_USER_SGPR_GFX1250(x) (((x) >> 1) & 0x3F)
1218#define C_00B84C_USER_SGPR_GFX1250 0xFFFFFF81
1219
1220#define R_0286CC_SPI_PS_INPUT_ENA 0x0286CC
1221#define R_0286D0_SPI_PS_INPUT_ADDR 0x0286D0
1222
1223#define R_00B848_COMPUTE_PGM_RSRC1 0x00B848
1224#define S_00B848_VGPRS(x) (((x) & 0x3F) << 0)
1225#define G_00B848_VGPRS(x) (((x) >> 0) & 0x3F)
1226#define C_00B848_VGPRS 0xFFFFFFC0
1227#define S_00B848_SGPRS(x) (((x) & 0x0F) << 6)
1228#define G_00B848_SGPRS(x) (((x) >> 6) & 0x0F)
1229#define C_00B848_SGPRS 0xFFFFFC3F
1230#define S_00B848_PRIORITY(x) (((x) & 0x03) << 10)
1231#define G_00B848_PRIORITY(x) (((x) >> 10) & 0x03)
1232#define C_00B848_PRIORITY 0xFFFFF3FF
1233#define S_00B848_FLOAT_MODE(x) (((x) & 0xFF) << 12)
1234#define G_00B848_FLOAT_MODE(x) (((x) >> 12) & 0xFF)
1235#define C_00B848_FLOAT_MODE 0xFFF00FFF
1236#define S_00B848_PRIV(x) (((x) & 0x1) << 20)
1237#define G_00B848_PRIV(x) (((x) >> 20) & 0x1)
1238#define C_00B848_PRIV 0xFFEFFFFF
1239#define S_00B848_DX10_CLAMP(x) (((x) & 0x1) << 21)
1240#define G_00B848_DX10_CLAMP(x) (((x) >> 21) & 0x1)
1241#define C_00B848_DX10_CLAMP 0xFFDFFFFF
1242#define S_00B848_RR_WG_MODE(x) (((x) & 0x1) << 21)
1243#define G_00B848_RR_WG_MODE(x) (((x) >> 21) & 0x1)
1244#define C_00B848_RR_WG_MODE 0xFFDFFFFF
1245#define S_00B848_DEBUG_MODE(x) (((x) & 0x1) << 22)
1246#define G_00B848_DEBUG_MODE(x) (((x) >> 22) & 0x1)
1247#define C_00B848_DEBUG_MODE 0xFFBFFFFF
1248#define S_00B848_IEEE_MODE(x) (((x) & 0x1) << 23)
1249#define G_00B848_IEEE_MODE(x) (((x) >> 23) & 0x1)
1250#define C_00B848_IEEE_MODE 0xFF7FFFFF
1251#define S_00B848_WGP_MODE(x) (((x) & 0x1) << 29)
1252#define G_00B848_WGP_MODE(x) (((x) >> 29) & 0x1)
1253#define C_00B848_WGP_MODE 0xDFFFFFFF
1254#define S_00B848_MEM_ORDERED(x) (((x) & 0x1) << 30)
1255#define G_00B848_MEM_ORDERED(x) (((x) >> 30) & 0x1)
1256#define C_00B848_MEM_ORDERED 0xBFFFFFFF
1257#define S_00B848_FWD_PROGRESS(x) (((x) & 0x1) << 31)
1258#define G_00B848_FWD_PROGRESS(x) (((x) >> 31) & 0x1)
1259#define C_00B848_FWD_PROGRESS 0x7FFFFFFF
1260
1261// Helpers for setting FLOAT_MODE
1262#define FP_ROUND_ROUND_TO_NEAREST 0
1263#define FP_ROUND_ROUND_TO_INF 1
1264#define FP_ROUND_ROUND_TO_NEGINF 2
1265#define FP_ROUND_ROUND_TO_ZERO 3
1266
1267// Bits 3:0 control rounding mode. 1:0 control single precision, 3:2 double
1268// precision.
1269#define FP_ROUND_MODE_SP(x) ((x) & 0x3)
1270#define FP_ROUND_MODE_DP(x) (((x) & 0x3) << 2)
1271
1272#define FP_DENORM_FLUSH_IN_FLUSH_OUT 0
1273#define FP_DENORM_FLUSH_OUT 1
1274#define FP_DENORM_FLUSH_IN 2
1275#define FP_DENORM_FLUSH_NONE 3
1276
1277
1278// Bits 7:4 control denormal handling. 5:4 control single precision, 6:7 double
1279// precision.
1280#define FP_DENORM_MODE_SP(x) (((x) & 0x3) << 4)
1281#define FP_DENORM_MODE_DP(x) (((x) & 0x3) << 6)
1282
1283#define R_00B860_COMPUTE_TMPRING_SIZE 0x00B860
1284#define S_00B860_WAVESIZE_PreGFX11(x) (((x) & 0x1FFF) << 12)
1285#define S_00B860_WAVESIZE_GFX11(x) (((x) & 0x7FFF) << 12)
1286#define S_00B860_WAVESIZE_GFX12Plus(x) (((x) & 0x3FFFF) << 12)
1287
1288#define R_0286E8_SPI_TMPRING_SIZE 0x0286E8
1289#define S_0286E8_WAVESIZE_PreGFX11(x) (((x) & 0x1FFF) << 12)
1290#define S_0286E8_WAVESIZE_GFX11(x) (((x) & 0x7FFF) << 12)
1291#define S_0286E8_WAVESIZE_GFX12Plus(x) (((x) & 0x3FFFF) << 12)
1292
1293#define R_028B54_VGT_SHADER_STAGES_EN 0x028B54
1294#define S_028B54_HS_W32_EN(x) (((x) & 0x1) << 21)
1295#define S_028B54_GS_W32_EN(x) (((x) & 0x1) << 22)
1296#define S_028B54_VS_W32_EN(x) (((x) & 0x1) << 23)
1297#define R_0286D8_SPI_PS_IN_CONTROL 0x0286D8
1298#define S_0286D8_PS_W32_EN(x) (((x) & 0x1) << 15)
1299#define R_00B800_COMPUTE_DISPATCH_INITIATOR 0x00B800
1300#define S_00B800_CS_W32_EN(x) (((x) & 0x1) << 15)
1301
1302#define R_SPILLED_SGPRS 0x4
1303#define R_SPILLED_VGPRS 0x8
1304
1305// clang-format on
1306
1307} // End namespace llvm
1308
1309#endif
AMDGPU address space definition.
@ OPERAND_KIMM32
Operand with 32-bit immediate that uses the constant bus.
Definition SIDefines.h:236
@ OPERAND_REG_INLINE_C_LAST
Definition SIDefines.h:259
@ OPERAND_REG_IMM_INT64
Definition SIDefines.h:206
@ OPERAND_REG_IMM_V2FP16
Definition SIDefines.h:213
@ OPERAND_REG_INLINE_C_FP64
Definition SIDefines.h:227
@ OPERAND_REG_INLINE_C_BF16
Definition SIDefines.h:224
@ OPERAND_REG_IMM_FIRST
Definition SIDefines.h:255
@ OPERAND_REG_INLINE_C_V2BF16
Definition SIDefines.h:229
@ 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:261
@ 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:223
@ OPERAND_REG_INLINE_C_INT16
Operands with register or inline constant.
Definition SIDefines.h:221
@ OPERAND_REG_IMM_NOINLINE_V2FP16
Definition SIDefines.h:216
@ OPERAND_REG_IMM_FP64
Definition SIDefines.h:209
@ OPERAND_REG_INLINE_C_V2FP16
Definition SIDefines.h:230
@ OPERAND_REG_INLINE_AC_INT32
Operands with an AccVGPR register or inline constant.
Definition SIDefines.h:241
@ OPERAND_REG_INLINE_AC_FP32
Definition SIDefines.h:242
@ OPERAND_REG_IMM_V2INT32
Definition SIDefines.h:217
@ OPERAND_SDWA_VOPC_DST
Definition SIDefines.h:253
@ OPERAND_REG_IMM_FP32
Definition SIDefines.h:208
@ OPERAND_REG_INLINE_C_FIRST
Definition SIDefines.h:258
@ OPERAND_REG_INLINE_C_FP32
Definition SIDefines.h:226
@ OPERAND_REG_INLINE_AC_LAST
Definition SIDefines.h:262
@ OPERAND_REG_IMM_LAST
Definition SIDefines.h:256
@ OPERAND_REG_INLINE_C_INT32
Definition SIDefines.h:222
@ OPERAND_REG_INLINE_C_V2INT16
Definition SIDefines.h:228
@ OPERAND_INLINE_C_AV64_PSEUDO
Definition SIDefines.h:247
@ OPERAND_REG_IMM_V2FP32
Definition SIDefines.h:218
@ OPERAND_REG_INLINE_AC_FP64
Definition SIDefines.h:243
@ OPERAND_REG_INLINE_C_FP16
Definition SIDefines.h:225
@ OPERAND_REG_IMM_INT16
Definition SIDefines.h:207
@ OPERAND_INLINE_SPLIT_BARRIER_INT32
Definition SIDefines.h:233
@ 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