LLVM 20.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};
49}
50
51namespace SIInstrFlags {
52// This needs to be kept in sync with the field bits in InstSI.
53enum : uint64_t {
54 // Low bits - basic encoding information.
55 SALU = 1 << 0,
56 VALU = 1 << 1,
57
58 // SALU instruction formats.
59 SOP1 = 1 << 2,
60 SOP2 = 1 << 3,
61 SOPC = 1 << 4,
62 SOPK = 1 << 5,
63 SOPP = 1 << 6,
64
65 // VALU instruction formats.
66 VOP1 = 1 << 7,
67 VOP2 = 1 << 8,
68 VOPC = 1 << 9,
69
70 // TODO: Should this be spilt into VOP3 a and b?
71 VOP3 = 1 << 10,
72 VOP3P = 1 << 12,
73
74 VINTRP = 1 << 13,
75 SDWA = 1 << 14,
76 DPP = 1 << 15,
77 TRANS = 1 << 16,
78
79 // Memory instruction formats.
80 MUBUF = 1 << 17,
81 MTBUF = 1 << 18,
82 SMRD = 1 << 19,
83 MIMG = 1 << 20,
84 VIMAGE = 1 << 21,
85 VSAMPLE = 1 << 22,
86 EXP = 1 << 23,
87 FLAT = 1 << 24,
88 DS = 1 << 25,
89
90 // Combined SGPR/VGPR Spill bit
91 // Logic to separate them out is done in isSGPRSpill and isVGPRSpill
92 Spill = 1 << 26,
93
94 // LDSDIR instruction format.
95 LDSDIR = 1 << 28,
96
97 // VINTERP instruction format.
98 VINTERP = 1 << 29,
99
100 // High bits - other information.
101 VM_CNT = UINT64_C(1) << 32,
102 EXP_CNT = UINT64_C(1) << 33,
103 LGKM_CNT = UINT64_C(1) << 34,
104
105 WQM = UINT64_C(1) << 35,
106 DisableWQM = UINT64_C(1) << 36,
107 Gather4 = UINT64_C(1) << 37,
108
109 // Reserved, must be 0.
110 Reserved0 = UINT64_C(1) << 38,
111
112 SCALAR_STORE = UINT64_C(1) << 39,
113 FIXED_SIZE = UINT64_C(1) << 40,
114
115 // Reserved, must be 0.
116 Reserved1 = UINT64_C(1) << 41,
117
118 VOP3_OPSEL = UINT64_C(1) << 42,
119 maybeAtomic = UINT64_C(1) << 43,
120 renamedInGFX9 = UINT64_C(1) << 44,
121
122 // Is a clamp on FP type.
123 FPClamp = UINT64_C(1) << 45,
124
125 // Is an integer clamp
126 IntClamp = UINT64_C(1) << 46,
127
128 // Clamps lo component of register.
129 ClampLo = UINT64_C(1) << 47,
130
131 // Clamps hi component of register.
132 // ClampLo and ClampHi set for packed clamp.
133 ClampHi = UINT64_C(1) << 48,
134
135 // Is a packed VOP3P instruction.
136 IsPacked = UINT64_C(1) << 49,
137
138 // Is a D16 buffer instruction.
139 D16Buf = UINT64_C(1) << 50,
140
141 // FLAT instruction accesses FLAT_GLBL segment.
142 FlatGlobal = UINT64_C(1) << 51,
143
144 // Uses floating point double precision rounding mode
145 FPDPRounding = UINT64_C(1) << 52,
146
147 // Instruction is FP atomic.
148 FPAtomic = UINT64_C(1) << 53,
149
150 // Is a MFMA instruction.
151 IsMAI = UINT64_C(1) << 54,
152
153 // Is a DOT instruction.
154 IsDOT = UINT64_C(1) << 55,
155
156 // FLAT instruction accesses FLAT_SCRATCH segment.
157 FlatScratch = UINT64_C(1) << 56,
158
159 // Atomic without return.
160 IsAtomicNoRet = UINT64_C(1) << 57,
161
162 // Atomic with return.
163 IsAtomicRet = UINT64_C(1) << 58,
164
165 // Is a WMMA instruction.
166 IsWMMA = UINT64_C(1) << 59,
167
168 // Whether tied sources will be read.
169 TiedSourceNotRead = UINT64_C(1) << 60,
170
171 // Is never uniform.
172 IsNeverUniform = UINT64_C(1) << 61,
173
174 // ds_gws_* instructions.
175 GWS = UINT64_C(1) << 62,
176
177 // Is a SWMMAC instruction.
178 IsSWMMAC = UINT64_C(1) << 63,
179};
180
181// v_cmp_class_* etc. use a 10-bit mask for what operation is checked.
182// The result is true if any of these tests are true.
183enum ClassFlags : unsigned {
184 S_NAN = 1 << 0, // Signaling NaN
185 Q_NAN = 1 << 1, // Quiet NaN
186 N_INFINITY = 1 << 2, // Negative infinity
187 N_NORMAL = 1 << 3, // Negative normal
188 N_SUBNORMAL = 1 << 4, // Negative subnormal
189 N_ZERO = 1 << 5, // Negative zero
190 P_ZERO = 1 << 6, // Positive zero
191 P_SUBNORMAL = 1 << 7, // Positive subnormal
192 P_NORMAL = 1 << 8, // Positive normal
193 P_INFINITY = 1 << 9 // Positive infinity
195}
196
197namespace AMDGPU {
198enum OperandType : unsigned {
199 /// Operands with register or 32-bit immediate
215
216 /// Operands with register or inline constant
229
230 // Operand for split barrier inline constant
232
233 /// Operand with 32-bit immediate that uses the constant bus.
236
237 /// Operands with an AccVGPR register or inline constant
249
250 // Operand for source modifiers for VOP instructions
252
253 // Operand for SDWA instructions
255
258
261
264
267
270
272
273// Should be in sync with the OperandSemantics defined in SIRegisterInfo.td
274enum OperandSemantics : unsigned {
275 INT = 0,
276 FP16 = 1,
277 BF16 = 2,
278 FP32 = 3,
279 FP64 = 4,
280};
281}
282
283// Input operand modifiers bit-masks
284// NEG and SEXT share same bit-mask because they can't be set simultaneously.
285namespace SISrcMods {
286 enum : unsigned {
287 NONE = 0,
288 NEG = 1 << 0, // Floating-point negate modifier
289 ABS = 1 << 1, // Floating-point absolute modifier
290 SEXT = 1 << 0, // Integer sign-extend modifier
291 NEG_HI = ABS, // Floating-point negate high packed component modifier.
292 OP_SEL_0 = 1 << 2,
293 OP_SEL_1 = 1 << 3,
294 DST_OP_SEL = 1 << 3 // VOP3 dst op_sel (share mask with OP_SEL_1)
295 };
296}
297
298namespace SIOutMods {
299 enum : unsigned {
300 NONE = 0,
301 MUL2 = 1,
302 MUL4 = 2,
303 DIV2 = 3
304 };
305}
306
307namespace AMDGPU {
308namespace VGPRIndexMode {
309
310enum Id : unsigned { // id of symbolic names
315
317 ID_MAX = ID_DST
319
320enum EncBits : unsigned {
321 OFF = 0,
327 UNDEF = 0xFFFF
329
330} // namespace VGPRIndexMode
331} // namespace AMDGPU
332
333namespace AMDGPUAsmVariants {
334 enum : unsigned {
336 VOP3 = 1,
337 SDWA = 2,
338 SDWA9 = 3,
339 DPP = 4,
340 VOP3_DPP = 5
341 };
342} // namespace AMDGPUAsmVariants
343
344namespace AMDGPU {
345namespace EncValues { // Encoding values of enum9/8/7 operands
346
347enum : unsigned {
361 VGPR_MIN = 256,
362 VGPR_MAX = 511,
363 IS_VGPR = 256, // Indicates VGPR or AGPR
364};
365
366} // namespace EncValues
367
368// Register codes as defined in the TableGen's HWEncoding field.
369namespace HWEncoding {
370enum : unsigned {
372 IS_VGPR = 1 << 8,
373 IS_AGPR = 1 << 9,
374 IS_HI16 = 1 << 10,
375};
376} // namespace HWEncoding
377
378namespace CPol {
379
380enum CPol {
381 GLC = 1,
382 SLC = 2,
383 DLC = 4,
384 SCC = 16,
390
391 // Below are GFX12+ cache policy bits
392
393 // Temporal hint
394 TH = 0x7, // All TH bits
395 TH_RT = 0, // regular
396 TH_NT = 1, // non-temporal
397 TH_HT = 2, // high-temporal
398 TH_LU = 3, // last use
399 TH_RT_WB = 3, // regular (CU, SE), high-temporal with write-back (MALL)
400 TH_NT_RT = 4, // non-temporal (CU, SE), regular (MALL)
401 TH_RT_NT = 5, // regular (CU, SE), non-temporal (MALL)
402 TH_NT_HT = 6, // non-temporal (CU, SE), high-temporal (MALL)
403 TH_NT_WB = 7, // non-temporal (CU, SE), high-temporal with write-back (MALL)
404 TH_BYPASS = 3, // only to be used with scope = 3
405
406 TH_RESERVED = 7, // unused value for load insts
407
408 // Bits of TH for atomics
409 TH_ATOMIC_RETURN = GLC, // Returning vs non-returning
410 TH_ATOMIC_NT = SLC, // Non-temporal vs regular
411 TH_ATOMIC_CASCADE = 4, // Cascading vs regular
412
413 // Scope
414 SCOPE = 0x3 << 3, // All Scope bits
415 SCOPE_CU = 0 << 3,
416 SCOPE_SE = 1 << 3,
417 SCOPE_DEV = 2 << 3,
418 SCOPE_SYS = 3 << 3,
419
420 SWZ = 1 << 6, // Swizzle bit
421
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};
434
435} // namespace CPol
436
437namespace SendMsg { // Encoding of SIMM16 used in s_sendmsg* insns.
438
439enum Id { // Message ID, width(4) [3:0].
441
442 ID_GS_PreGFX11 = 2, // replaced in GFX11
443 ID_GS_DONE_PreGFX11 = 3, // replaced in GFX11
444
445 ID_HS_TESSFACTOR_GFX11Plus = 2, // reused in GFX11
446 ID_DEALLOC_VGPRS_GFX11Plus = 3, // reused in GFX11
447
448 ID_SAVEWAVE = 4, // added in GFX8, removed in GFX11
449 ID_STALL_WAVE_GEN = 5, // added in GFX9, removed in GFX12
450 ID_HALT_WAVES = 6, // added in GFX9, removed in GFX12
451 ID_ORDERED_PS_DONE = 7, // added in GFX9, removed in GFX11
452 ID_EARLY_PRIM_DEALLOC = 8, // added in GFX9, removed in GFX10
453 ID_GS_ALLOC_REQ = 9, // added in GFX9
454 ID_GET_DOORBELL = 10, // added in GFX9, removed in GFX11
455 ID_GET_DDID = 11, // added in GFX10, removed in GFX11
457
466
468 ID_MASK_GFX11Plus_ = 0xFF
470
471enum Op { // Both GS and SYS operation IDs.
474 // Bits used for operation encoding
476 OP_MASK_ = (((1 << OP_WIDTH_) - 1) << OP_SHIFT_),
477 // GS operations are encoded in bits 5:4
483 // SYS operations are encoded in bits 6:4
489};
490
491enum StreamId : unsigned { // Stream ID, (2) [9:8].
500
501} // namespace SendMsg
502
503namespace Hwreg { // Encoding of SIMM16 used in s_setreg/getreg* insns.
504
505enum Id { // HwRegCode, (6) [5:0]
532
533 // Register numbers reused in GFX11
536
537 // Register numbers reused in GFX12+
544
545 // GFX940 specific registers
551};
552
553enum Offset : unsigned { // Offset, (5) [10:6]
555};
556
558 FP_ROUND_MASK = 0xf << 0, // Bits 0..3
559 FP_DENORM_MASK = 0xf << 4, // Bits 4..7
562 LOD_CLAMP_MASK = 1 << 10,
563 DEBUG_MASK = 1 << 11,
564
565 // EXCP_EN fields.
573
575 VSKIP_MASK = 1 << 28,
576 CSP_MASK = 0x7u << 29 // Bits 29..31
578
579} // namespace Hwreg
580
581namespace MTBUFFormat {
582
583enum DataFormat : int64_t {
600
603
606
608 DFMT_MASK = 0xF
610
611enum NumFormat : int64_t {
618 NFMT_RESERVED_6, // VI and GFX9
619 NFMT_SNORM_OGL = NFMT_RESERVED_6, // SI and CI only
621
624
627
629 NFMT_MASK = 7
631
632enum MergedFormat : int64_t {
636
637
639
642
643enum UnifiedFormatCommon : int64_t {
644 UFMT_MAX = 127,
646 UFMT_DEFAULT = 1
648
649} // namespace MTBUFFormat
650
651namespace UfmtGFX10 {
652enum UnifiedFormat : int64_t {
654
661
669
676
680
688
696
704
711
718
725
729
737
744
747};
748
749} // namespace UfmtGFX10
750
751namespace UfmtGFX11 {
752enum UnifiedFormat : int64_t {
754
761
769
776
780
788
790
792
797
804
811
815
823
830
833};
834
835} // namespace UfmtGFX11
836
837namespace Swizzle { // Encoding of swizzle macro used in ds_swizzle_b32.
838
839enum Id : unsigned { // id of symbolic names
848
849// clang-format off
850enum EncBits : unsigned {
851
852 // swizzle mode encodings
853
856
859
860 FFT_MODE_ENC = 0xE000,
861
864
866 FFT_MODE_LO = 0xE000,
867
868 // QUAD_PERM encodings
869
874
875 // BITMASK_PERM encodings
876
880
884
885 // FFT encodings
886
889
890 // ROTATE encodings
892 ROTATE_DIR_SHIFT = 10, // bit position of rotate direction
894 ROTATE_SIZE_SHIFT = 5, // bit position of rotate size
896};
897// clang-format on
898
899} // namespace Swizzle
900
901namespace SDWA {
902
903enum SdwaSel : unsigned {
910 DWORD = 6,
911};
912
913enum DstUnused : unsigned {
917};
918
919enum SDWA9EncValues : unsigned {
924
932};
933
934} // namespace SDWA
935
936namespace DPP {
937
938// clang-format off
939enum DppCtrl : unsigned {
941 QUAD_PERM_ID = 0xE4, // identity permutation
943 DPP_UNUSED1 = 0x100,
944 ROW_SHL0 = 0x100,
947 DPP_UNUSED2 = 0x110,
948 ROW_SHR0 = 0x110,
951 DPP_UNUSED3 = 0x120,
952 ROW_ROR0 = 0x120,
955 WAVE_SHL1 = 0x130,
958 WAVE_ROL1 = 0x134,
961 WAVE_SHR1 = 0x138,
964 WAVE_ROR1 = 0x13C,
967 ROW_MIRROR = 0x140,
969 BCAST15 = 0x142,
970 BCAST31 = 0x143,
975 ROW_SHARE0 = 0x150,
978 ROW_XMASK0 = 0x160,
983// clang-format on
984
988 DPP8_FI_0 = 0xE9,
989 DPP8_FI_1 = 0xEA,
990};
991
992} // namespace DPP
993
994namespace Exp {
995
996enum Target : unsigned {
1000 ET_NULL = 9, // Pre-GFX11
1003 ET_POS4 = 16, // GFX10+
1004 ET_POS_LAST = ET_POS4, // Highest pos used on any subtarget
1005 ET_PRIM = 20, // GFX10+
1006 ET_DUAL_SRC_BLEND0 = 21, // GFX11+
1007 ET_DUAL_SRC_BLEND1 = 22, // GFX11+
1008 ET_PARAM0 = 32, // Pre-GFX11
1009 ET_PARAM31 = 63, // Pre-GFX11
1010
1018
1020};
1021
1022} // namespace Exp
1023
1024namespace VOP3PEncoding {
1025
1027 OP_SEL_HI_0 = UINT64_C(1) << 59,
1028 OP_SEL_HI_1 = UINT64_C(1) << 60,
1029 OP_SEL_HI_2 = UINT64_C(1) << 14,
1030};
1031
1032} // namespace VOP3PEncoding
1033
1034namespace ImplicitArg {
1035// Implicit kernel argument offset for code object version 5.
1036enum Offset_COV5 : unsigned {
1040
1043
1047};
1048
1049} // namespace ImplicitArg
1050
1052// Enum value used in cbsz/blgp for F8F6F4 MFMA operations to select the matrix
1053// format.
1059 FP4_E2M1 = 4
1061} // namespace MFMAScaleFormats
1062
1063namespace VirtRegFlag {
1064// Virtual register flags used for various target specific handlings during
1065// codegen.
1067 // Register operand in a whole-wave mode operation.
1068 WWM_REG = 1 << 0,
1069};
1070
1071} // namespace VirtRegFlag
1072
1073} // namespace AMDGPU
1074
1075namespace AMDGPU {
1076namespace Barrier {
1077
1078enum Type { TRAP = -2, WORKGROUP = -1 };
1079
1080enum {
1082};
1083
1084} // namespace Barrier
1085} // namespace AMDGPU
1086
1087// clang-format off
1088
1089#define R_00B028_SPI_SHADER_PGM_RSRC1_PS 0x00B028
1090#define S_00B028_VGPRS(x) (((x) & 0x3F) << 0)
1091#define S_00B028_SGPRS(x) (((x) & 0x0F) << 6)
1092#define S_00B028_MEM_ORDERED(x) (((x) & 0x1) << 25)
1093#define G_00B028_MEM_ORDERED(x) (((x) >> 25) & 0x1)
1094#define C_00B028_MEM_ORDERED 0xFDFFFFFF
1095
1096#define R_00B02C_SPI_SHADER_PGM_RSRC2_PS 0x00B02C
1097#define S_00B02C_EXTRA_LDS_SIZE(x) (((x) & 0xFF) << 8)
1098#define R_00B128_SPI_SHADER_PGM_RSRC1_VS 0x00B128
1099#define S_00B128_MEM_ORDERED(x) (((x) & 0x1) << 27)
1100#define G_00B128_MEM_ORDERED(x) (((x) >> 27) & 0x1)
1101#define C_00B128_MEM_ORDERED 0xF7FFFFFF
1102
1103#define R_00B228_SPI_SHADER_PGM_RSRC1_GS 0x00B228
1104#define S_00B228_WGP_MODE(x) (((x) & 0x1) << 27)
1105#define G_00B228_WGP_MODE(x) (((x) >> 27) & 0x1)
1106#define C_00B228_WGP_MODE 0xF7FFFFFF
1107#define S_00B228_MEM_ORDERED(x) (((x) & 0x1) << 25)
1108#define G_00B228_MEM_ORDERED(x) (((x) >> 25) & 0x1)
1109#define C_00B228_MEM_ORDERED 0xFDFFFFFF
1110
1111#define R_00B328_SPI_SHADER_PGM_RSRC1_ES 0x00B328
1112#define R_00B428_SPI_SHADER_PGM_RSRC1_HS 0x00B428
1113#define S_00B428_WGP_MODE(x) (((x) & 0x1) << 26)
1114#define G_00B428_WGP_MODE(x) (((x) >> 26) & 0x1)
1115#define C_00B428_WGP_MODE 0xFBFFFFFF
1116#define S_00B428_MEM_ORDERED(x) (((x) & 0x1) << 24)
1117#define G_00B428_MEM_ORDERED(x) (((x) >> 24) & 0x1)
1118#define C_00B428_MEM_ORDERED 0xFEFFFFFF
1119
1120#define R_00B528_SPI_SHADER_PGM_RSRC1_LS 0x00B528
1121
1122#define R_00B84C_COMPUTE_PGM_RSRC2 0x00B84C
1123#define S_00B84C_SCRATCH_EN(x) (((x) & 0x1) << 0)
1124#define G_00B84C_SCRATCH_EN(x) (((x) >> 0) & 0x1)
1125#define C_00B84C_SCRATCH_EN 0xFFFFFFFE
1126#define S_00B84C_USER_SGPR(x) (((x) & 0x1F) << 1)
1127#define G_00B84C_USER_SGPR(x) (((x) >> 1) & 0x1F)
1128#define C_00B84C_USER_SGPR 0xFFFFFFC1
1129#define S_00B84C_TRAP_HANDLER(x) (((x) & 0x1) << 6)
1130#define G_00B84C_TRAP_HANDLER(x) (((x) >> 6) & 0x1)
1131#define C_00B84C_TRAP_HANDLER 0xFFFFFFBF
1132#define S_00B84C_TGID_X_EN(x) (((x) & 0x1) << 7)
1133#define G_00B84C_TGID_X_EN(x) (((x) >> 7) & 0x1)
1134#define C_00B84C_TGID_X_EN 0xFFFFFF7F
1135#define S_00B84C_TGID_Y_EN(x) (((x) & 0x1) << 8)
1136#define G_00B84C_TGID_Y_EN(x) (((x) >> 8) & 0x1)
1137#define C_00B84C_TGID_Y_EN 0xFFFFFEFF
1138#define S_00B84C_TGID_Z_EN(x) (((x) & 0x1) << 9)
1139#define G_00B84C_TGID_Z_EN(x) (((x) >> 9) & 0x1)
1140#define C_00B84C_TGID_Z_EN 0xFFFFFDFF
1141#define S_00B84C_TG_SIZE_EN(x) (((x) & 0x1) << 10)
1142#define G_00B84C_TG_SIZE_EN(x) (((x) >> 10) & 0x1)
1143#define C_00B84C_TG_SIZE_EN 0xFFFFFBFF
1144#define S_00B84C_TIDIG_COMP_CNT(x) (((x) & 0x03) << 11)
1145#define G_00B84C_TIDIG_COMP_CNT(x) (((x) >> 11) & 0x03)
1146#define C_00B84C_TIDIG_COMP_CNT 0xFFFFE7FF
1147/* CIK */
1148#define S_00B84C_EXCP_EN_MSB(x) (((x) & 0x03) << 13)
1149#define G_00B84C_EXCP_EN_MSB(x) (((x) >> 13) & 0x03)
1150#define C_00B84C_EXCP_EN_MSB 0xFFFF9FFF
1151/* */
1152#define S_00B84C_LDS_SIZE(x) (((x) & 0x1FF) << 15)
1153#define G_00B84C_LDS_SIZE(x) (((x) >> 15) & 0x1FF)
1154#define C_00B84C_LDS_SIZE 0xFF007FFF
1155#define S_00B84C_EXCP_EN(x) (((x) & 0x7F) << 24)
1156#define G_00B84C_EXCP_EN(x) (((x) >> 24) & 0x7F)
1157#define C_00B84C_EXCP_EN 0x80FFFFFF
1158
1159#define R_0286CC_SPI_PS_INPUT_ENA 0x0286CC
1160#define R_0286D0_SPI_PS_INPUT_ADDR 0x0286D0
1161
1162#define R_00B848_COMPUTE_PGM_RSRC1 0x00B848
1163#define S_00B848_VGPRS(x) (((x) & 0x3F) << 0)
1164#define G_00B848_VGPRS(x) (((x) >> 0) & 0x3F)
1165#define C_00B848_VGPRS 0xFFFFFFC0
1166#define S_00B848_SGPRS(x) (((x) & 0x0F) << 6)
1167#define G_00B848_SGPRS(x) (((x) >> 6) & 0x0F)
1168#define C_00B848_SGPRS 0xFFFFFC3F
1169#define S_00B848_PRIORITY(x) (((x) & 0x03) << 10)
1170#define G_00B848_PRIORITY(x) (((x) >> 10) & 0x03)
1171#define C_00B848_PRIORITY 0xFFFFF3FF
1172#define S_00B848_FLOAT_MODE(x) (((x) & 0xFF) << 12)
1173#define G_00B848_FLOAT_MODE(x) (((x) >> 12) & 0xFF)
1174#define C_00B848_FLOAT_MODE 0xFFF00FFF
1175#define S_00B848_PRIV(x) (((x) & 0x1) << 20)
1176#define G_00B848_PRIV(x) (((x) >> 20) & 0x1)
1177#define C_00B848_PRIV 0xFFEFFFFF
1178#define S_00B848_DX10_CLAMP(x) (((x) & 0x1) << 21)
1179#define G_00B848_DX10_CLAMP(x) (((x) >> 21) & 0x1)
1180#define C_00B848_DX10_CLAMP 0xFFDFFFFF
1181#define S_00B848_RR_WG_MODE(x) (((x) & 0x1) << 21)
1182#define G_00B848_RR_WG_MODE(x) (((x) >> 21) & 0x1)
1183#define C_00B848_RR_WG_MODE 0xFFDFFFFF
1184#define S_00B848_DEBUG_MODE(x) (((x) & 0x1) << 22)
1185#define G_00B848_DEBUG_MODE(x) (((x) >> 22) & 0x1)
1186#define C_00B848_DEBUG_MODE 0xFFBFFFFF
1187#define S_00B848_IEEE_MODE(x) (((x) & 0x1) << 23)
1188#define G_00B848_IEEE_MODE(x) (((x) >> 23) & 0x1)
1189#define C_00B848_IEEE_MODE 0xFF7FFFFF
1190#define S_00B848_WGP_MODE(x) (((x) & 0x1) << 29)
1191#define G_00B848_WGP_MODE(x) (((x) >> 29) & 0x1)
1192#define C_00B848_WGP_MODE 0xDFFFFFFF
1193#define S_00B848_MEM_ORDERED(x) (((x) & 0x1) << 30)
1194#define G_00B848_MEM_ORDERED(x) (((x) >> 30) & 0x1)
1195#define C_00B848_MEM_ORDERED 0xBFFFFFFF
1196#define S_00B848_FWD_PROGRESS(x) (((x) & 0x1) << 31)
1197#define G_00B848_FWD_PROGRESS(x) (((x) >> 31) & 0x1)
1198#define C_00B848_FWD_PROGRESS 0x7FFFFFFF
1199
1200// Helpers for setting FLOAT_MODE
1201#define FP_ROUND_ROUND_TO_NEAREST 0
1202#define FP_ROUND_ROUND_TO_INF 1
1203#define FP_ROUND_ROUND_TO_NEGINF 2
1204#define FP_ROUND_ROUND_TO_ZERO 3
1205
1206// Bits 3:0 control rounding mode. 1:0 control single precision, 3:2 double
1207// precision.
1208#define FP_ROUND_MODE_SP(x) ((x) & 0x3)
1209#define FP_ROUND_MODE_DP(x) (((x) & 0x3) << 2)
1210
1211#define FP_DENORM_FLUSH_IN_FLUSH_OUT 0
1212#define FP_DENORM_FLUSH_OUT 1
1213#define FP_DENORM_FLUSH_IN 2
1214#define FP_DENORM_FLUSH_NONE 3
1215
1216
1217// Bits 7:4 control denormal handling. 5:4 control single precision, 6:7 double
1218// precision.
1219#define FP_DENORM_MODE_SP(x) (((x) & 0x3) << 4)
1220#define FP_DENORM_MODE_DP(x) (((x) & 0x3) << 6)
1221
1222#define R_00B860_COMPUTE_TMPRING_SIZE 0x00B860
1223#define S_00B860_WAVESIZE_PreGFX11(x) (((x) & 0x1FFF) << 12)
1224#define S_00B860_WAVESIZE_GFX11(x) (((x) & 0x7FFF) << 12)
1225#define S_00B860_WAVESIZE_GFX12Plus(x) (((x) & 0x3FFFF) << 12)
1226
1227#define R_0286E8_SPI_TMPRING_SIZE 0x0286E8
1228#define S_0286E8_WAVESIZE_PreGFX11(x) (((x) & 0x1FFF) << 12)
1229#define S_0286E8_WAVESIZE_GFX11(x) (((x) & 0x7FFF) << 12)
1230#define S_0286E8_WAVESIZE_GFX12Plus(x) (((x) & 0x3FFFF) << 12)
1231
1232#define R_028B54_VGT_SHADER_STAGES_EN 0x028B54
1233#define S_028B54_HS_W32_EN(x) (((x) & 0x1) << 21)
1234#define S_028B54_GS_W32_EN(x) (((x) & 0x1) << 22)
1235#define S_028B54_VS_W32_EN(x) (((x) & 0x1) << 23)
1236#define R_0286D8_SPI_PS_IN_CONTROL 0x0286D8
1237#define S_0286D8_PS_W32_EN(x) (((x) & 0x1) << 15)
1238#define R_00B800_COMPUTE_DISPATCH_INITIATOR 0x00B800
1239#define S_00B800_CS_W32_EN(x) (((x) & 0x1) << 15)
1240
1241#define R_SPILLED_SGPRS 0x4
1242#define R_SPILLED_VGPRS 0x8
1243
1244// clang-format on
1245
1246} // End namespace llvm
1247
1248#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:269
@ OPERAND_KIMM32
Operand with 32-bit immediate that uses the constant bus.
Definition: SIDefines.h:234
@ OPERAND_REG_INLINE_C_LAST
Definition: SIDefines.h:260
@ OPERAND_REG_INLINE_AC_V2FP32
Definition: SIDefines.h:248
@ OPERAND_REG_INLINE_AC_V2INT32
Definition: SIDefines.h:247
@ OPERAND_REG_IMM_INT64
Definition: SIDefines.h:201
@ OPERAND_REG_IMM_V2FP16
Definition: SIDefines.h:211
@ OPERAND_REG_INLINE_C_V2INT32
Definition: SIDefines.h:227
@ OPERAND_REG_INLINE_C_FP64
Definition: SIDefines.h:223
@ OPERAND_REG_INLINE_C_BF16
Definition: SIDefines.h:220
@ OPERAND_REG_IMM_FIRST
Definition: SIDefines.h:256
@ OPERAND_REG_INLINE_C_V2BF16
Definition: SIDefines.h:225
@ OPERAND_REG_IMM_V2INT16
Definition: SIDefines.h:212
@ OPERAND_REG_IMM_BF16
Definition: SIDefines.h:205
@ OPERAND_REG_INLINE_AC_V2FP16
Definition: SIDefines.h:246
@ OPERAND_REG_IMM_INT32
Operands with register or 32-bit immediate.
Definition: SIDefines.h:200
@ OPERAND_SRC_FIRST
Definition: SIDefines.h:265
@ OPERAND_REG_IMM_V2BF16
Definition: SIDefines.h:210
@ OPERAND_REG_INLINE_AC_FIRST
Definition: SIDefines.h:262
@ OPERAND_KIMM_FIRST
Definition: SIDefines.h:268
@ OPERAND_REG_IMM_BF16_DEFERRED
Definition: SIDefines.h:207
@ OPERAND_REG_IMM_FP16
Definition: SIDefines.h:206
@ OPERAND_REG_INLINE_C_INT64
Definition: SIDefines.h:219
@ OPERAND_REG_INLINE_AC_BF16
Definition: SIDefines.h:240
@ OPERAND_REG_INLINE_C_INT16
Operands with register or inline constant.
Definition: SIDefines.h:217
@ OPERAND_REG_INLINE_AC_INT16
Operands with an AccVGPR register or inline constant.
Definition: SIDefines.h:238
@ OPERAND_REG_IMM_FP64
Definition: SIDefines.h:204
@ OPERAND_REG_INLINE_C_V2FP16
Definition: SIDefines.h:226
@ OPERAND_REG_INLINE_AC_V2INT16
Definition: SIDefines.h:244
@ OPERAND_REG_INLINE_AC_FP16
Definition: SIDefines.h:241
@ OPERAND_REG_INLINE_AC_INT32
Definition: SIDefines.h:239
@ OPERAND_REG_INLINE_AC_FP32
Definition: SIDefines.h:242
@ OPERAND_REG_INLINE_AC_V2BF16
Definition: SIDefines.h:245
@ OPERAND_REG_IMM_V2INT32
Definition: SIDefines.h:213
@ OPERAND_SDWA_VOPC_DST
Definition: SIDefines.h:254
@ OPERAND_REG_IMM_FP32
Definition: SIDefines.h:203
@ OPERAND_INPUT_MODS
Definition: SIDefines.h:251
@ OPERAND_REG_INLINE_C_FIRST
Definition: SIDefines.h:259
@ OPERAND_REG_INLINE_C_FP32
Definition: SIDefines.h:222
@ 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:218
@ OPERAND_REG_INLINE_C_V2INT16
Definition: SIDefines.h:224
@ OPERAND_REG_IMM_V2FP32
Definition: SIDefines.h:214
@ OPERAND_REG_INLINE_AC_FP64
Definition: SIDefines.h:243
@ OPERAND_REG_INLINE_C_FP16
Definition: SIDefines.h:221
@ OPERAND_REG_IMM_INT16
Definition: SIDefines.h:202
@ OPERAND_REG_INLINE_C_V2FP32
Definition: SIDefines.h:228
@ OPERAND_INLINE_SPLIT_BARRIER_INT32
Definition: SIDefines.h:231
@ OPERAND_REG_IMM_FP32_DEFERRED
Definition: SIDefines.h:209
@ OPERAND_SRC_LAST
Definition: SIDefines.h:266
@ OPERAND_REG_IMM_FP16_DEFERRED
Definition: SIDefines.h:208
@ OPERAND_FIRST_TARGET
Definition: MCInstrDesc.h:78
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