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.
23
27
30}; // enum SIRCFlagsr
31
32namespace SIEncodingFamily {
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
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 source modifiers for VOP instructions
242
243 // Operand for SDWA instructions
245
246 // Operand for AV_MOV_B64_IMM_PSEUDO, which is a pair of 32-bit inline
247 // constants.
249
252
255
258
261
264
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)
281}
282
283namespace SIOutMods {
284 enum : unsigned {
285 NONE = 0,
286 MUL2 = 1,
287 MUL4 = 2,
288 DIV2 = 3
289 };
290}
291
292namespace AMDGPU {
293namespace VGPRIndexMode {
294
295enum Id : unsigned { // id of symbolic names
300
302 ID_MAX = ID_DST
304
305enum EncBits : unsigned {
306 OFF = 0,
312 UNDEF = 0xFFFF
314
315} // namespace VGPRIndexMode
316} // namespace AMDGPU
317
318namespace AMDGPUAsmVariants {
319 enum : unsigned {
321 VOP3 = 1,
322 SDWA = 2,
323 SDWA9 = 3,
324 DPP = 4,
325 VOP3_DPP = 5
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 {
358 IS_VGPR = 1 << 8,
359 IS_AGPR = 1 << 9,
360 IS_HI16 = 1 << 10,
361};
362} // namespace HWEncoding
363
364namespace CPol {
365
366enum CPol {
367 GLC = 1,
368 SLC = 2,
369 DLC = 4,
370 SCC = 16,
376
377 // Below are GFX12+ cache policy bits
378
379 // Temporal hint
380 TH = 0x7, // All TH bits
381 TH_RT = 0, // regular
382 TH_NT = 1, // non-temporal
383 TH_HT = 2, // high-temporal
384 TH_LU = 3, // last use
385 TH_WB = 3, // regular (CU, SE), high-temporal with write-back (MALL)
386 TH_NT_RT = 4, // non-temporal (CU, SE), regular (MALL)
387 TH_RT_NT = 5, // regular (CU, SE), non-temporal (MALL)
388 TH_NT_HT = 6, // non-temporal (CU, SE), high-temporal (MALL)
389 TH_NT_WB = 7, // non-temporal (CU, SE), high-temporal with write-back (MALL)
390 TH_BYPASS = 3, // only to be used with scope = 3
391
392 TH_RESERVED = 7, // unused value for load insts
393
394 // Bits of TH for atomics
395 TH_ATOMIC_RETURN = GLC, // Returning vs non-returning
396 TH_ATOMIC_NT = SLC, // Non-temporal vs regular
397 TH_ATOMIC_CASCADE = 4, // Cascading vs regular
398
399 // Scope
402 SCOPE = SCOPE_MASK << SCOPE_SHIFT, // All Scope bits
407
408 NV = 1 << 5, // Non-volatile bit
409
410 SWZ = 1 << 6, // Swizzle bit
411
412 SCAL = 1 << 11, // Scale offset bit
413
414 ALL = TH | SCOPE | NV,
415
416 // Helper bits
417 TH_TYPE_LOAD = 1 << 7, // TH_LOAD policy
418 TH_TYPE_STORE = 1 << 8, // TH_STORE policy
419 TH_TYPE_ATOMIC = 1 << 9, // TH_ATOMIC policy
420 TH_REAL_BYPASS = 1 << 10, // is TH=3 bypass policy or not
421
422 // Volatile (used to preserve/signal operation volatility for buffer
423 // operations not a real instruction bit)
424 VOLATILE = 1 << 31,
425};
426
427} // namespace CPol
428
429namespace SendMsg { // Encoding of SIMM16 used in s_sendmsg* insns.
430
431enum Id { // Message ID, width(4) [3:0].
433
434 ID_GS_PreGFX11 = 2, // replaced in GFX11
435 ID_GS_DONE_PreGFX11 = 3, // replaced in GFX11
436
437 ID_HS_TESSFACTOR_GFX11Plus = 2, // reused in GFX11
438 ID_DEALLOC_VGPRS_GFX11Plus = 3, // reused in GFX11
439
440 ID_SAVEWAVE = 4, // added in GFX8, removed in GFX11
441 ID_STALL_WAVE_GEN = 5, // added in GFX9, removed in GFX12
442 ID_HALT_WAVES = 6, // added in GFX9, removed in GFX12
443 ID_ORDERED_PS_DONE = 7, // added in GFX9, removed in GFX11
444 ID_EARLY_PRIM_DEALLOC = 8, // added in GFX9, removed in GFX10
445 ID_GS_ALLOC_REQ = 9, // added in GFX9
446 ID_GET_DOORBELL = 10, // added in GFX9, removed in GFX11
447 ID_SAVEWAVE_HAS_TDM = 10, // added in GFX1250
448 ID_GET_DDID = 11, // added in GFX10, removed in GFX11
450
459
461 ID_MASK_GFX11Plus_ = 0xFF
463
464enum Op { // Both GS and SYS operation IDs.
467 // Bits used for operation encoding
469 OP_MASK_ = (((1 << OP_WIDTH_) - 1) << OP_SHIFT_),
470 // GS operations are encoded in bits 5:4
476 // SYS operations are encoded in bits 6:4
482};
483
484enum StreamId : unsigned { // Stream ID, (2) [9:8].
493
494} // namespace SendMsg
495
496namespace Hwreg { // Encoding of SIMM16 used in s_setreg/getreg* insns.
497
498enum Id { // HwRegCode, (6) [5:0]
526
527 // Register numbers reused in GFX11
530
531 // Register numbers reused in GFX12+
538
539 // GFX94* specific registers
545
546 // GFX1250
549};
550
551enum Offset : unsigned { // Offset, (5) [10:6]
553 OFFSET_ME_ID = 8, // in HW_ID2
554};
555
557 FP_ROUND_MASK = 0xf << 0, // Bits 0..3
558 FP_DENORM_MASK = 0xf << 4, // Bits 4..7
561 LOD_CLAMP_MASK = 1 << 10,
562 DEBUG_MASK = 1 << 11,
563
564 // EXCP_EN fields.
572
574 VSKIP_MASK = 1 << 28,
575 CSP_MASK = 0x7u << 29 // Bits 29..31
577
578} // namespace Hwreg
579
580namespace MTBUFFormat {
581
582enum DataFormat : int64_t {
599
602
605
607 DFMT_MASK = 0xF
609
610enum NumFormat : int64_t {
617 NFMT_RESERVED_6, // VI and GFX9
618 NFMT_SNORM_OGL = NFMT_RESERVED_6, // SI and CI only
620
623
626
628 NFMT_MASK = 7
630
631enum MergedFormat : int64_t {
635
636
638
641
642enum UnifiedFormatCommon : int64_t {
643 UFMT_MAX = 127,
645 UFMT_DEFAULT = 1
647
648} // namespace MTBUFFormat
649
650namespace UfmtGFX10 {
651enum UnifiedFormat : int64_t {
653
660
668
675
679
687
695
703
710
717
724
728
736
743
746};
747
748} // namespace UfmtGFX10
749
750namespace UfmtGFX11 {
751enum UnifiedFormat : int64_t {
753
760
768
775
779
787
789
791
796
803
810
814
822
829
832};
833
834} // namespace UfmtGFX11
835
836namespace Swizzle { // Encoding of swizzle macro used in ds_swizzle_b32.
837
838enum Id : unsigned { // id of symbolic names
847
848// clang-format off
849enum EncBits : unsigned {
850
851 // swizzle mode encodings
852
855
858
859 FFT_MODE_ENC = 0xE000,
860
863
865 FFT_MODE_LO = 0xE000,
866
867 // QUAD_PERM encodings
868
873
874 // BITMASK_PERM encodings
875
879
883
884 // FFT encodings
885
888
889 // ROTATE encodings
891 ROTATE_DIR_SHIFT = 10, // bit position of rotate direction
893 ROTATE_SIZE_SHIFT = 5, // bit position of rotate size
895};
896// clang-format on
897
898} // namespace Swizzle
899
900namespace SDWA {
901
902enum SdwaSel : unsigned {
909 DWORD = 6,
910};
911
912enum DstUnused : unsigned {
916};
917
918enum SDWA9EncValues : unsigned {
923
931};
932
933} // namespace SDWA
934
935namespace DPP {
936
937// clang-format off
938enum DppCtrl : unsigned {
940 QUAD_PERM_ID = 0xE4, // identity permutation
942 DPP_UNUSED1 = 0x100,
943 ROW_SHL0 = 0x100,
946 DPP_UNUSED2 = 0x110,
947 ROW_SHR0 = 0x110,
950 DPP_UNUSED3 = 0x120,
951 ROW_ROR0 = 0x120,
954 WAVE_SHL1 = 0x130,
957 WAVE_ROL1 = 0x134,
960 WAVE_SHR1 = 0x138,
963 WAVE_ROR1 = 0x13C,
966 ROW_MIRROR = 0x140,
968 BCAST15 = 0x142,
969 BCAST31 = 0x143,
974 ROW_SHARE0 = 0x150,
977 ROW_XMASK0 = 0x160,
982// clang-format on
983
987 DPP8_FI_0 = 0xE9,
988 DPP8_FI_1 = 0xEA,
989};
990
991} // namespace DPP
992
993namespace Exp {
994
995enum Target : unsigned {
999 ET_NULL = 9, // Pre-GFX11
1002 ET_POS4 = 16, // GFX10+
1003 ET_POS_LAST = ET_POS4, // Highest pos used on any subtarget
1004 ET_PRIM = 20, // GFX10+
1005 ET_DUAL_SRC_BLEND0 = 21, // GFX11+
1006 ET_DUAL_SRC_BLEND1 = 22, // GFX11+
1007 ET_PARAM0 = 32, // Pre-GFX11
1008 ET_PARAM31 = 63, // Pre-GFX11
1009
1017
1019};
1020
1021} // namespace Exp
1022
1023namespace WMMA {
1024enum MatrixFMT : unsigned {
1029 MATRIX_FMT_FP4 = 4
1031
1032enum MatrixScale : unsigned {
1035};
1036
1037enum MatrixScaleFmt : unsigned {
1042} // namespace WMMA
1043
1044namespace VOP3PEncoding {
1045
1047 OP_SEL_HI_0 = UINT64_C(1) << 59,
1048 OP_SEL_HI_1 = UINT64_C(1) << 60,
1049 OP_SEL_HI_2 = UINT64_C(1) << 14,
1050};
1051
1052} // namespace VOP3PEncoding
1053
1054namespace ImplicitArg {
1055// Implicit kernel argument offset for code object version 5.
1056enum Offset_COV5 : unsigned {
1060
1063
1067};
1068
1069} // namespace ImplicitArg
1070
1072// Enum value used in cbsz/blgp for F8F6F4 MFMA operations to select the matrix
1073// format.
1079 FP4_E2M1 = 4
1081} // namespace MFMAScaleFormats
1082
1083namespace VirtRegFlag {
1084// Virtual register flags used for various target specific handlings during
1085// codegen.
1087 // Register operand in a whole-wave mode operation.
1088 WWM_REG = 1 << 0,
1089};
1090
1091} // namespace VirtRegFlag
1092
1093} // namespace AMDGPU
1094
1095namespace AMDGPU {
1096namespace Barrier {
1097
1098enum Type { TRAP = -2, WORKGROUP = -1 };
1099
1100enum {
1102};
1103
1104} // namespace Barrier
1105} // namespace AMDGPU
1106
1107// clang-format off
1108
1109#define R_00B028_SPI_SHADER_PGM_RSRC1_PS 0x00B028
1110#define S_00B028_VGPRS(x) (((x) & 0x3F) << 0)
1111#define S_00B028_SGPRS(x) (((x) & 0x0F) << 6)
1112#define S_00B028_MEM_ORDERED(x) (((x) & 0x1) << 25)
1113#define G_00B028_MEM_ORDERED(x) (((x) >> 25) & 0x1)
1114#define C_00B028_MEM_ORDERED 0xFDFFFFFF
1115
1116#define R_00B02C_SPI_SHADER_PGM_RSRC2_PS 0x00B02C
1117#define S_00B02C_EXTRA_LDS_SIZE(x) (((x) & 0xFF) << 8)
1118#define R_00B128_SPI_SHADER_PGM_RSRC1_VS 0x00B128
1119#define S_00B128_MEM_ORDERED(x) (((x) & 0x1) << 27)
1120#define G_00B128_MEM_ORDERED(x) (((x) >> 27) & 0x1)
1121#define C_00B128_MEM_ORDERED 0xF7FFFFFF
1122
1123#define R_00B228_SPI_SHADER_PGM_RSRC1_GS 0x00B228
1124#define S_00B228_WGP_MODE(x) (((x) & 0x1) << 27)
1125#define G_00B228_WGP_MODE(x) (((x) >> 27) & 0x1)
1126#define C_00B228_WGP_MODE 0xF7FFFFFF
1127#define S_00B228_MEM_ORDERED(x) (((x) & 0x1) << 25)
1128#define G_00B228_MEM_ORDERED(x) (((x) >> 25) & 0x1)
1129#define C_00B228_MEM_ORDERED 0xFDFFFFFF
1130
1131#define R_00B328_SPI_SHADER_PGM_RSRC1_ES 0x00B328
1132#define R_00B428_SPI_SHADER_PGM_RSRC1_HS 0x00B428
1133#define S_00B428_WGP_MODE(x) (((x) & 0x1) << 26)
1134#define G_00B428_WGP_MODE(x) (((x) >> 26) & 0x1)
1135#define C_00B428_WGP_MODE 0xFBFFFFFF
1136#define S_00B428_MEM_ORDERED(x) (((x) & 0x1) << 24)
1137#define G_00B428_MEM_ORDERED(x) (((x) >> 24) & 0x1)
1138#define C_00B428_MEM_ORDERED 0xFEFFFFFF
1139
1140#define R_00B528_SPI_SHADER_PGM_RSRC1_LS 0x00B528
1141
1142#define R_00B84C_COMPUTE_PGM_RSRC2 0x00B84C
1143#define S_00B84C_SCRATCH_EN(x) (((x) & 0x1) << 0)
1144#define G_00B84C_SCRATCH_EN(x) (((x) >> 0) & 0x1)
1145#define C_00B84C_SCRATCH_EN 0xFFFFFFFE
1146#define S_00B84C_USER_SGPR(x) (((x) & 0x1F) << 1)
1147#define G_00B84C_USER_SGPR(x) (((x) >> 1) & 0x1F)
1148#define C_00B84C_USER_SGPR 0xFFFFFFC1
1149#define S_00B84C_TRAP_HANDLER(x) (((x) & 0x1) << 6)
1150#define G_00B84C_TRAP_HANDLER(x) (((x) >> 6) & 0x1)
1151#define C_00B84C_TRAP_HANDLER 0xFFFFFFBF
1152#define S_00B84C_TGID_X_EN(x) (((x) & 0x1) << 7)
1153#define G_00B84C_TGID_X_EN(x) (((x) >> 7) & 0x1)
1154#define C_00B84C_TGID_X_EN 0xFFFFFF7F
1155#define S_00B84C_TGID_Y_EN(x) (((x) & 0x1) << 8)
1156#define G_00B84C_TGID_Y_EN(x) (((x) >> 8) & 0x1)
1157#define C_00B84C_TGID_Y_EN 0xFFFFFEFF
1158#define S_00B84C_TGID_Z_EN(x) (((x) & 0x1) << 9)
1159#define G_00B84C_TGID_Z_EN(x) (((x) >> 9) & 0x1)
1160#define C_00B84C_TGID_Z_EN 0xFFFFFDFF
1161#define S_00B84C_TG_SIZE_EN(x) (((x) & 0x1) << 10)
1162#define G_00B84C_TG_SIZE_EN(x) (((x) >> 10) & 0x1)
1163#define C_00B84C_TG_SIZE_EN 0xFFFFFBFF
1164#define S_00B84C_TIDIG_COMP_CNT(x) (((x) & 0x03) << 11)
1165#define G_00B84C_TIDIG_COMP_CNT(x) (((x) >> 11) & 0x03)
1166#define C_00B84C_TIDIG_COMP_CNT 0xFFFFE7FF
1167/* CIK */
1168#define S_00B84C_EXCP_EN_MSB(x) (((x) & 0x03) << 13)
1169#define G_00B84C_EXCP_EN_MSB(x) (((x) >> 13) & 0x03)
1170#define C_00B84C_EXCP_EN_MSB 0xFFFF9FFF
1171/* */
1172#define S_00B84C_LDS_SIZE(x) (((x) & 0x1FF) << 15)
1173#define G_00B84C_LDS_SIZE(x) (((x) >> 15) & 0x1FF)
1174#define C_00B84C_LDS_SIZE 0xFF007FFF
1175#define S_00B84C_EXCP_EN(x) (((x) & 0x7F) << 24)
1176#define G_00B84C_EXCP_EN(x) (((x) >> 24) & 0x7F)
1177#define C_00B84C_EXCP_EN 0x80FFFFFF
1178
1179#define R_0286CC_SPI_PS_INPUT_ENA 0x0286CC
1180#define R_0286D0_SPI_PS_INPUT_ADDR 0x0286D0
1181
1182#define R_00B848_COMPUTE_PGM_RSRC1 0x00B848
1183#define S_00B848_VGPRS(x) (((x) & 0x3F) << 0)
1184#define G_00B848_VGPRS(x) (((x) >> 0) & 0x3F)
1185#define C_00B848_VGPRS 0xFFFFFFC0
1186#define S_00B848_SGPRS(x) (((x) & 0x0F) << 6)
1187#define G_00B848_SGPRS(x) (((x) >> 6) & 0x0F)
1188#define C_00B848_SGPRS 0xFFFFFC3F
1189#define S_00B848_PRIORITY(x) (((x) & 0x03) << 10)
1190#define G_00B848_PRIORITY(x) (((x) >> 10) & 0x03)
1191#define C_00B848_PRIORITY 0xFFFFF3FF
1192#define S_00B848_FLOAT_MODE(x) (((x) & 0xFF) << 12)
1193#define G_00B848_FLOAT_MODE(x) (((x) >> 12) & 0xFF)
1194#define C_00B848_FLOAT_MODE 0xFFF00FFF
1195#define S_00B848_PRIV(x) (((x) & 0x1) << 20)
1196#define G_00B848_PRIV(x) (((x) >> 20) & 0x1)
1197#define C_00B848_PRIV 0xFFEFFFFF
1198#define S_00B848_DX10_CLAMP(x) (((x) & 0x1) << 21)
1199#define G_00B848_DX10_CLAMP(x) (((x) >> 21) & 0x1)
1200#define C_00B848_DX10_CLAMP 0xFFDFFFFF
1201#define S_00B848_RR_WG_MODE(x) (((x) & 0x1) << 21)
1202#define G_00B848_RR_WG_MODE(x) (((x) >> 21) & 0x1)
1203#define C_00B848_RR_WG_MODE 0xFFDFFFFF
1204#define S_00B848_DEBUG_MODE(x) (((x) & 0x1) << 22)
1205#define G_00B848_DEBUG_MODE(x) (((x) >> 22) & 0x1)
1206#define C_00B848_DEBUG_MODE 0xFFBFFFFF
1207#define S_00B848_IEEE_MODE(x) (((x) & 0x1) << 23)
1208#define G_00B848_IEEE_MODE(x) (((x) >> 23) & 0x1)
1209#define C_00B848_IEEE_MODE 0xFF7FFFFF
1210#define S_00B848_WGP_MODE(x) (((x) & 0x1) << 29)
1211#define G_00B848_WGP_MODE(x) (((x) >> 29) & 0x1)
1212#define C_00B848_WGP_MODE 0xDFFFFFFF
1213#define S_00B848_MEM_ORDERED(x) (((x) & 0x1) << 30)
1214#define G_00B848_MEM_ORDERED(x) (((x) >> 30) & 0x1)
1215#define C_00B848_MEM_ORDERED 0xBFFFFFFF
1216#define S_00B848_FWD_PROGRESS(x) (((x) & 0x1) << 31)
1217#define G_00B848_FWD_PROGRESS(x) (((x) >> 31) & 0x1)
1218#define C_00B848_FWD_PROGRESS 0x7FFFFFFF
1219
1220// Helpers for setting FLOAT_MODE
1221#define FP_ROUND_ROUND_TO_NEAREST 0
1222#define FP_ROUND_ROUND_TO_INF 1
1223#define FP_ROUND_ROUND_TO_NEGINF 2
1224#define FP_ROUND_ROUND_TO_ZERO 3
1225
1226// Bits 3:0 control rounding mode. 1:0 control single precision, 3:2 double
1227// precision.
1228#define FP_ROUND_MODE_SP(x) ((x) & 0x3)
1229#define FP_ROUND_MODE_DP(x) (((x) & 0x3) << 2)
1230
1231#define FP_DENORM_FLUSH_IN_FLUSH_OUT 0
1232#define FP_DENORM_FLUSH_OUT 1
1233#define FP_DENORM_FLUSH_IN 2
1234#define FP_DENORM_FLUSH_NONE 3
1235
1236
1237// Bits 7:4 control denormal handling. 5:4 control single precision, 6:7 double
1238// precision.
1239#define FP_DENORM_MODE_SP(x) (((x) & 0x3) << 4)
1240#define FP_DENORM_MODE_DP(x) (((x) & 0x3) << 6)
1241
1242#define R_00B860_COMPUTE_TMPRING_SIZE 0x00B860
1243#define S_00B860_WAVESIZE_PreGFX11(x) (((x) & 0x1FFF) << 12)
1244#define S_00B860_WAVESIZE_GFX11(x) (((x) & 0x7FFF) << 12)
1245#define S_00B860_WAVESIZE_GFX12Plus(x) (((x) & 0x3FFFF) << 12)
1246
1247#define R_0286E8_SPI_TMPRING_SIZE 0x0286E8
1248#define S_0286E8_WAVESIZE_PreGFX11(x) (((x) & 0x1FFF) << 12)
1249#define S_0286E8_WAVESIZE_GFX11(x) (((x) & 0x7FFF) << 12)
1250#define S_0286E8_WAVESIZE_GFX12Plus(x) (((x) & 0x3FFFF) << 12)
1251
1252#define R_028B54_VGT_SHADER_STAGES_EN 0x028B54
1253#define S_028B54_HS_W32_EN(x) (((x) & 0x1) << 21)
1254#define S_028B54_GS_W32_EN(x) (((x) & 0x1) << 22)
1255#define S_028B54_VS_W32_EN(x) (((x) & 0x1) << 23)
1256#define R_0286D8_SPI_PS_IN_CONTROL 0x0286D8
1257#define S_0286D8_PS_W32_EN(x) (((x) & 0x1) << 15)
1258#define R_00B800_COMPUTE_DISPATCH_INITIATOR 0x00B800
1259#define S_00B800_CS_W32_EN(x) (((x) & 0x1) << 15)
1260
1261#define R_SPILLED_SGPRS 0x4
1262#define R_SPILLED_VGPRS 0x8
1263
1264// clang-format on
1265
1266} // End namespace llvm
1267
1268#endif
static std::vector< std::pair< int, unsigned > > Swizzle(std::vector< std::pair< int, unsigned > > Src, R600InstrInfo::BankSwizzle Swz)
@ OPERAND_KIMM_LAST
Definition: SIDefines.h:263
@ 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_SRC_FIRST
Definition: SIDefines.h:259
@ OPERAND_REG_IMM_V2BF16
Definition: SIDefines.h:208
@ OPERAND_REG_INLINE_AC_FIRST
Definition: SIDefines.h:256
@ OPERAND_KIMM_FIRST
Definition: SIDefines.h:262
@ 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:244
@ OPERAND_REG_IMM_FP32
Definition: SIDefines.h:204
@ OPERAND_INPUT_MODS
Definition: SIDefines.h:241
@ 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:248
@ 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_SRC_LAST
Definition: SIDefines.h:260
@ OPERAND_FIRST_TARGET
Definition: MCInstrDesc.h:79
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
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