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