LLVM  14.0.0git
R600Defines.h
Go to the documentation of this file.
1 //===-- R600Defines.h - R600 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_R600DEFINES_H
11 #define LLVM_LIB_TARGET_AMDGPU_R600DEFINES_H
12 
13 // Operand Flags
14 #define MO_FLAG_CLAMP (1 << 0)
15 #define MO_FLAG_NEG (1 << 1)
16 #define MO_FLAG_ABS (1 << 2)
17 #define MO_FLAG_MASK (1 << 3)
18 #define MO_FLAG_PUSH (1 << 4)
19 #define MO_FLAG_NOT_LAST (1 << 5)
20 #define MO_FLAG_LAST (1 << 6)
21 #define NUM_MO_FLAGS 7
22 
23 /// Helper for getting the operand index for the instruction flags
24 /// operand.
25 #define GET_FLAG_OPERAND_IDX(Flags) (((Flags) >> 7) & 0x3)
26 
27 namespace R600_InstFlag {
28  enum TIF {
29  TRANS_ONLY = (1 << 0),
30  TEX = (1 << 1),
31  REDUCTION = (1 << 2),
32  FC = (1 << 3),
33  TRIG = (1 << 4),
34  OP3 = (1 << 5),
35  VECTOR = (1 << 6),
36  //FlagOperand bits 7, 8
37  NATIVE_OPERANDS = (1 << 9),
38  OP1 = (1 << 10),
39  OP2 = (1 << 11),
40  VTX_INST = (1 << 12),
41  TEX_INST = (1 << 13),
42  ALU_INST = (1 << 14),
43  LDS_1A = (1 << 15),
44  LDS_1A1D = (1 << 16),
45  IS_EXPORT = (1 << 17),
46  LDS_1A2D = (1 << 18)
47  };
48 }
49 
50 #define HAS_NATIVE_OPERANDS(Flags) ((Flags) & R600_InstFlag::NATIVE_OPERANDS)
51 
52 /// Defines for extracting register information from register encoding
53 #define HW_REG_MASK 0x1ff
54 #define HW_CHAN_SHIFT 9
55 
56 #define GET_REG_CHAN(reg) ((reg) >> HW_CHAN_SHIFT)
57 #define GET_REG_INDEX(reg) ((reg) & HW_REG_MASK)
58 
59 #define IS_VTX(desc) ((desc).TSFlags & R600_InstFlag::VTX_INST)
60 #define IS_TEX(desc) ((desc).TSFlags & R600_InstFlag::TEX_INST)
61 
62 namespace OpName {
63 
64  enum VecOps {
136  };
137 
138 }
139 
140 //===----------------------------------------------------------------------===//
141 // Config register definitions
142 //===----------------------------------------------------------------------===//
143 
144 #define R_02880C_DB_SHADER_CONTROL 0x02880C
145 #define S_02880C_KILL_ENABLE(x) (((x) & 0x1) << 6)
146 
147 // These fields are the same for all shader types and families.
148 #define S_NUM_GPRS(x) (((x) & 0xFF) << 0)
149 #define S_STACK_SIZE(x) (((x) & 0xFF) << 8)
150 //===----------------------------------------------------------------------===//
151 // R600, R700 Registers
152 //===----------------------------------------------------------------------===//
153 
154 #define R_028850_SQ_PGM_RESOURCES_PS 0x028850
155 #define R_028868_SQ_PGM_RESOURCES_VS 0x028868
156 
157 //===----------------------------------------------------------------------===//
158 // Evergreen, Northern Islands Registers
159 //===----------------------------------------------------------------------===//
160 
161 #define R_028844_SQ_PGM_RESOURCES_PS 0x028844
162 #define R_028860_SQ_PGM_RESOURCES_VS 0x028860
163 #define R_028878_SQ_PGM_RESOURCES_GS 0x028878
164 #define R_0288D4_SQ_PGM_RESOURCES_LS 0x0288d4
165 
166 #define R_0288E8_SQ_LDS_ALLOC 0x0288E8
167 
168 #endif
R600_InstFlag::ALU_INST
@ ALU_INST
Definition: R600Defines.h:42
R600_InstFlag::OP3
@ OP3
Definition: R600Defines.h:34
R600_InstFlag::TEX
@ TEX
Definition: R600Defines.h:30
OpName::SRC1_ABS_Y
@ SRC1_ABS_Y
Definition: R600Defines.h:96
OpName::DST_REL_Z
@ DST_REL_Z
Definition: R600Defines.h:103
R600_InstFlag::OP1
@ OP1
Definition: R600Defines.h:38
OpName::SRC1_SEL_X
@ SRC1_SEL_X
Definition: R600Defines.h:80
OpName::SRC1_ABS_W
@ SRC1_ABS_W
Definition: R600Defines.h:130
OpName::WRITE_Z
@ WRITE_Z
Definition: R600Defines.h:101
R600_InstFlag::FC
@ FC
Definition: R600Defines.h:32
R600_InstFlag::VECTOR
@ VECTOR
Definition: R600Defines.h:35
OpName::SRC0_ABS_Y
@ SRC0_ABS_Y
Definition: R600Defines.h:91
R600_InstFlag::TRIG
@ TRIG
Definition: R600Defines.h:33
OpName::SRC0_NEG_Z
@ SRC0_NEG_Z
Definition: R600Defines.h:106
OpName::OMOD_Z
@ OMOD_Z
Definition: R600Defines.h:102
OpName::VecOps
VecOps
Definition: R600Defines.h:64
R600_InstFlag::TIF
TIF
Definition: R600Defines.h:28
OpName::SRC0_SEL_Z
@ SRC0_SEL_Z
Definition: R600Defines.h:109
R600_InstFlag::LDS_1A2D
@ LDS_1A2D
Definition: R600Defines.h:46
OpName::WRITE_X
@ WRITE_X
Definition: R600Defines.h:67
R600_InstFlag::IS_EXPORT
@ IS_EXPORT
Definition: R600Defines.h:45
OpName::OMOD_Y
@ OMOD_Y
Definition: R600Defines.h:85
OpName::SRC0_NEG_X
@ SRC0_NEG_X
Definition: R600Defines.h:72
OpName::SRC1_Y
@ SRC1_Y
Definition: R600Defines.h:93
OpName::PRED_SEL_Z
@ PRED_SEL_Z
Definition: R600Defines.h:115
OpName::UPDATE_EXEC_MASK_Z
@ UPDATE_EXEC_MASK_Z
Definition: R600Defines.h:99
OpName::CLAMP_Y
@ CLAMP_Y
Definition: R600Defines.h:87
OpName::WRITE_W
@ WRITE_W
Definition: R600Defines.h:118
OpName::SRC1_REL_X
@ SRC1_REL_X
Definition: R600Defines.h:78
OpName::SRC1_NEG_X
@ SRC1_NEG_X
Definition: R600Defines.h:77
OpName::SRC0_SEL_X
@ SRC0_SEL_X
Definition: R600Defines.h:75
OpName::UPDATE_PREDICATE_Y
@ UPDATE_PREDICATE_Y
Definition: R600Defines.h:83
R600_InstFlag
Definition: R600Defines.h:27
OpName
Definition: R600Defines.h:62
R600_InstFlag::TEX_INST
@ TEX_INST
Definition: R600Defines.h:41
OpName::SRC1_SEL_Z
@ SRC1_SEL_Z
Definition: R600Defines.h:114
OpName::WRITE_Y
@ WRITE_Y
Definition: R600Defines.h:84
OpName::UPDATE_PREDICATE_X
@ UPDATE_PREDICATE_X
Definition: R600Defines.h:66
OpName::SRC0_W
@ SRC0_W
Definition: R600Defines.h:122
OpName::IMM_0
@ IMM_0
Definition: R600Defines.h:133
OpName::SRC1_ABS_Z
@ SRC1_ABS_Z
Definition: R600Defines.h:113
OpName::SRC0_ABS_Z
@ SRC0_ABS_Z
Definition: R600Defines.h:108
OpName::SRC0_X
@ SRC0_X
Definition: R600Defines.h:71
OpName::IMM_1
@ IMM_1
Definition: R600Defines.h:134
OpName::OMOD_W
@ OMOD_W
Definition: R600Defines.h:119
OpName::CLAMP_X
@ CLAMP_X
Definition: R600Defines.h:70
OpName::UPDATE_EXEC_MASK_Y
@ UPDATE_EXEC_MASK_Y
Definition: R600Defines.h:82
OpName::SRC1_X
@ SRC1_X
Definition: R600Defines.h:76
OpName::UPDATE_PREDICATE_W
@ UPDATE_PREDICATE_W
Definition: R600Defines.h:117
R600_InstFlag::TRANS_ONLY
@ TRANS_ONLY
Definition: R600Defines.h:29
R600_InstFlag::REDUCTION
@ REDUCTION
Definition: R600Defines.h:31
OpName::SRC1_NEG_W
@ SRC1_NEG_W
Definition: R600Defines.h:128
OpName::SRC0_NEG_Y
@ SRC0_NEG_Y
Definition: R600Defines.h:89
R600_InstFlag::OP2
@ OP2
Definition: R600Defines.h:39
OpName::SRC0_SEL_W
@ SRC0_SEL_W
Definition: R600Defines.h:126
OpName::SRC0_REL_X
@ SRC0_REL_X
Definition: R600Defines.h:73
OpName::SRC0_REL_W
@ SRC0_REL_W
Definition: R600Defines.h:124
OpName::CLAMP_W
@ CLAMP_W
Definition: R600Defines.h:121
OpName::SRC0_ABS_X
@ SRC0_ABS_X
Definition: R600Defines.h:74
OpName::SRC0_NEG_W
@ SRC0_NEG_W
Definition: R600Defines.h:123
OpName::DST_REL_W
@ DST_REL_W
Definition: R600Defines.h:120
OpName::PRED_SEL_Y
@ PRED_SEL_Y
Definition: R600Defines.h:98
R600_InstFlag::NATIVE_OPERANDS
@ NATIVE_OPERANDS
Definition: R600Defines.h:37
OpName::SRC1_SEL_W
@ SRC1_SEL_W
Definition: R600Defines.h:131
OpName::SRC1_SEL_Y
@ SRC1_SEL_Y
Definition: R600Defines.h:97
R600_InstFlag::LDS_1A1D
@ LDS_1A1D
Definition: R600Defines.h:44
OpName::CLAMP_Z
@ CLAMP_Z
Definition: R600Defines.h:104
OpName::UPDATE_EXEC_MASK_W
@ UPDATE_EXEC_MASK_W
Definition: R600Defines.h:116
OpName::SRC1_W
@ SRC1_W
Definition: R600Defines.h:127
OpName::VEC_COUNT
@ VEC_COUNT
Definition: R600Defines.h:135
OpName::DST_REL_X
@ DST_REL_X
Definition: R600Defines.h:69
OpName::SRC1_Z
@ SRC1_Z
Definition: R600Defines.h:110
OpName::SRC1_REL_W
@ SRC1_REL_W
Definition: R600Defines.h:129
OpName::SRC0_REL_Z
@ SRC0_REL_Z
Definition: R600Defines.h:107
OpName::PRED_SEL_W
@ PRED_SEL_W
Definition: R600Defines.h:132
OpName::SRC1_NEG_Z
@ SRC1_NEG_Z
Definition: R600Defines.h:111
R600_InstFlag::LDS_1A
@ LDS_1A
Definition: R600Defines.h:43
OpName::DST_REL_Y
@ DST_REL_Y
Definition: R600Defines.h:86
OpName::SRC0_SEL_Y
@ SRC0_SEL_Y
Definition: R600Defines.h:92
OpName::SRC0_Z
@ SRC0_Z
Definition: R600Defines.h:105
OpName::SRC1_REL_Z
@ SRC1_REL_Z
Definition: R600Defines.h:112
OpName::UPDATE_PREDICATE_Z
@ UPDATE_PREDICATE_Z
Definition: R600Defines.h:100
OpName::SRC0_Y
@ SRC0_Y
Definition: R600Defines.h:88
OpName::SRC1_REL_Y
@ SRC1_REL_Y
Definition: R600Defines.h:95
OpName::PRED_SEL_X
@ PRED_SEL_X
Definition: R600Defines.h:81
OpName::OMOD_X
@ OMOD_X
Definition: R600Defines.h:68
OpName::UPDATE_EXEC_MASK_X
@ UPDATE_EXEC_MASK_X
Definition: R600Defines.h:65
OpName::SRC1_NEG_Y
@ SRC1_NEG_Y
Definition: R600Defines.h:94
OpName::SRC1_ABS_X
@ SRC1_ABS_X
Definition: R600Defines.h:79
R600_InstFlag::VTX_INST
@ VTX_INST
Definition: R600Defines.h:40
OpName::SRC0_ABS_W
@ SRC0_ABS_W
Definition: R600Defines.h:125
OpName::SRC0_REL_Y
@ SRC0_REL_Y
Definition: R600Defines.h:90