• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2010 Jerome Glisse <glisse@freedesktop.org>
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * on the rights to use, copy, modify, merge, publish, distribute, sub
8  * license, and/or sell copies of the Software, and to permit persons to whom
9  * the Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice (including the next
12  * paragraph) shall be included in all copies or substantial portions of the
13  * Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18  * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
19  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21  * USE OR OTHER DEALINGS IN THE SOFTWARE.
22  *
23  * Authors:
24  *      Jerome Glisse
25  */
26 #ifndef R600_SQ_H
27 #define R600_SQ_H
28 
29 #define P_SQ_CF_WORD0
30 #define   S_SQ_CF_WORD0_ADDR(x)                                      (((unsigned)(x) & 0xFFFFFFFF) << 0)
31 #define   G_SQ_CF_WORD0_ADDR(x)                                      (((x) >> 0) & 0xFFFFFFFF)
32 #define   C_SQ_CF_WORD0_ADDR                                         0x00000000
33 #define P_SQ_CF_WORD1
34 #define   S_SQ_CF_WORD1_POP_COUNT(x)                                 (((unsigned)(x) & 0x7) << 0)
35 #define   G_SQ_CF_WORD1_POP_COUNT(x)                                 (((x) >> 0) & 0x7)
36 #define   C_SQ_CF_WORD1_POP_COUNT                                    0xFFFFFFF8
37 #define   S_SQ_CF_WORD1_CF_CONST(x)                                  (((unsigned)(x) & 0x1F) << 3)
38 #define   G_SQ_CF_WORD1_CF_CONST(x)                                  (((x) >> 3) & 0x1F)
39 #define   C_SQ_CF_WORD1_CF_CONST                                     0xFFFFFF07
40 #define   S_SQ_CF_WORD1_COND(x)                                      (((unsigned)(x) & 0x3) << 8)
41 #define   G_SQ_CF_WORD1_COND(x)                                      (((x) >> 8) & 0x3)
42 #define   C_SQ_CF_WORD1_COND                                         0xFFFFFCFF
43 #define   S_SQ_CF_WORD1_COUNT(x)                                     (((unsigned)(x) & 0x7) << 10)
44 #define   G_SQ_CF_WORD1_COUNT(x)                                     (((x) >> 10) & 0x7)
45 #define   C_SQ_CF_WORD1_COUNT                                        0xFFFFE3FF
46 #define   S_SQ_CF_WORD1_CALL_COUNT(x)                                (((unsigned)(x) & 0x3F) << 13)
47 #define   G_SQ_CF_WORD1_CALL_COUNT(x)                                (((x) >> 13) & 0x3F)
48 #define   C_SQ_CF_WORD1_CALL_COUNT                                   0xFFF81FFF
49 #define   S_SQ_CF_WORD1_END_OF_PROGRAM(x)                            (((unsigned)(x) & 0x1) << 21)
50 #define   G_SQ_CF_WORD1_END_OF_PROGRAM(x)                            (((x) >> 21) & 0x1)
51 #define   C_SQ_CF_WORD1_END_OF_PROGRAM                               0xFFDFFFFF
52 #define   S_SQ_CF_WORD1_VALID_PIXEL_MODE(x)                          (((unsigned)(x) & 0x1) << 22)
53 #define   G_SQ_CF_WORD1_VALID_PIXEL_MODE(x)                          (((x) >> 22) & 0x1)
54 #define   C_SQ_CF_WORD1_VALID_PIXEL_MODE                             0xFFBFFFFF
55 #define   S_SQ_CF_WORD1_CF_INST(x)                                   (((unsigned)(x) & 0x7F) << 23)
56 #define   G_SQ_CF_WORD1_CF_INST(x)                                   (((x) >> 23) & 0x7F)
57 #define   C_SQ_CF_WORD1_CF_INST                                      0xC07FFFFF
58 #define   S_SQ_CF_WORD1_WHOLE_QUAD_MODE(x)                           (((unsigned)(x) & 0x1) << 30)
59 #define   G_SQ_CF_WORD1_WHOLE_QUAD_MODE(x)                           (((x) >> 30) & 0x1)
60 #define   C_SQ_CF_WORD1_WHOLE_QUAD_MODE                              0xBFFFFFFF
61 #define   S_SQ_CF_WORD1_BARRIER(x)                                   (((unsigned)(x) & 0x1) << 31)
62 #define   G_SQ_CF_WORD1_BARRIER(x)                                   (((x) >> 31) & 0x1)
63 #define   C_SQ_CF_WORD1_BARRIER                                      0x7FFFFFFF
64 #define P_SQ_CF_ALU_WORD0
65 #define   S_SQ_CF_ALU_WORD0_ADDR(x)                                  (((unsigned)(x) & 0x3FFFFF) << 0)
66 #define   G_SQ_CF_ALU_WORD0_ADDR(x)                                  (((x) >> 0) & 0x3FFFFF)
67 #define   C_SQ_CF_ALU_WORD0_ADDR                                     0xFFC00000
68 #define   S_SQ_CF_ALU_WORD0_KCACHE_BANK0(x)                          (((unsigned)(x) & 0xF) << 22)
69 #define   G_SQ_CF_ALU_WORD0_KCACHE_BANK0(x)                          (((x) >> 22) & 0xF)
70 #define   C_SQ_CF_ALU_WORD0_KCACHE_BANK0                             0xFC3FFFFF
71 #define   S_SQ_CF_ALU_WORD0_KCACHE_BANK1(x)                          (((unsigned)(x) & 0xF) << 26)
72 #define   G_SQ_CF_ALU_WORD0_KCACHE_BANK1(x)                          (((x) >> 26) & 0xF)
73 #define   C_SQ_CF_ALU_WORD0_KCACHE_BANK1                             0xC3FFFFFF
74 #define   S_SQ_CF_ALU_WORD0_KCACHE_MODE0(x)                          (((unsigned)(x) & 0x3) << 30)
75 #define   G_SQ_CF_ALU_WORD0_KCACHE_MODE0(x)                          (((x) >> 30) & 0x3)
76 #define   C_SQ_CF_ALU_WORD0_KCACHE_MODE0                             0x3FFFFFFF
77 #define     V_SQ_CF_KCACHE_NOP                                       0x00000000
78 #define     V_SQ_CF_KCACHE_LOCK_1                                    0x00000001
79 #define     V_SQ_CF_KCACHE_LOCK_2                                    0x00000002
80 #define     V_SQ_CF_KCACHE_LOCK_LOOP_INDEX                           0x00000003
81 #define P_SQ_CF_ALU_WORD1
82 #define   S_SQ_CF_ALU_WORD1_KCACHE_MODE1(x)                          (((unsigned)(x) & 0x3) << 0)
83 #define   G_SQ_CF_ALU_WORD1_KCACHE_MODE1(x)                          (((x) >> 0) & 0x3)
84 #define   C_SQ_CF_ALU_WORD1_KCACHE_MODE1                             0xFFFFFFFC
85 #define   S_SQ_CF_ALU_WORD1_KCACHE_ADDR0(x)                          (((unsigned)(x) & 0xFF) << 2)
86 #define   G_SQ_CF_ALU_WORD1_KCACHE_ADDR0(x)                          (((x) >> 2) & 0xFF)
87 #define   C_SQ_CF_ALU_WORD1_KCACHE_ADDR0                             0xFFFFFC03
88 #define   S_SQ_CF_ALU_WORD1_KCACHE_ADDR1(x)                          (((unsigned)(x) & 0xFF) << 10)
89 #define   G_SQ_CF_ALU_WORD1_KCACHE_ADDR1(x)                          (((x) >> 10) & 0xFF)
90 #define   C_SQ_CF_ALU_WORD1_KCACHE_ADDR1                             0xFFFC03FF
91 #define   S_SQ_CF_ALU_WORD1_COUNT(x)                                 (((unsigned)(x) & 0x7F) << 18)
92 #define   G_SQ_CF_ALU_WORD1_COUNT(x)                                 (((x) >> 18) & 0x7F)
93 #define   C_SQ_CF_ALU_WORD1_COUNT                                    0xFE03FFFF
94 #define   S_SQ_CF_ALU_WORD1_USES_WATERFALL(x)                        (((unsigned)(x) & 0x1) << 25)
95 #define   G_SQ_CF_ALU_WORD1_USES_WATERFALL(x)                        (((x) >> 25) & 0x1)
96 #define   C_SQ_CF_ALU_WORD1_USES_WATERFALL                           0xFDFFFFFF
97 #define   S_SQ_CF_ALU_WORD1_CF_INST(x)                               (((unsigned)(x) & 0xF) << 26)
98 #define   G_SQ_CF_ALU_WORD1_CF_INST(x)                               (((x) >> 26) & 0xF)
99 #define   C_SQ_CF_ALU_WORD1_CF_INST                                  0xC3FFFFFF
100 #define   S_SQ_CF_ALU_WORD1_WHOLE_QUAD_MODE(x)                       (((unsigned)(x) & 0x1) << 30)
101 #define   G_SQ_CF_ALU_WORD1_WHOLE_QUAD_MODE(x)                       (((x) >> 30) & 0x1)
102 #define   C_SQ_CF_ALU_WORD1_WHOLE_QUAD_MODE                          0xBFFFFFFF
103 #define   S_SQ_CF_ALU_WORD1_BARRIER(x)                               (((unsigned)(x) & 0x1) << 31)
104 #define   G_SQ_CF_ALU_WORD1_BARRIER(x)                               (((x) >> 31) & 0x1)
105 #define   C_SQ_CF_ALU_WORD1_BARRIER                                  0x7FFFFFFF
106 #define P_SQ_CF_ALLOC_EXPORT_WORD0
107 #define   S_SQ_CF_ALLOC_EXPORT_WORD0_ARRAY_BASE(x)                   (((unsigned)(x) & 0x1FFF) << 0)
108 #define   G_SQ_CF_ALLOC_EXPORT_WORD0_ARRAY_BASE(x)                   (((x) >> 0) & 0x1FFF)
109 #define   C_SQ_CF_ALLOC_EXPORT_WORD0_ARRAY_BASE                      0xFFFFE000
110 #define   S_SQ_CF_ALLOC_EXPORT_WORD0_TYPE(x)                         (((unsigned)(x) & 0x3) << 13)
111 #define   G_SQ_CF_ALLOC_EXPORT_WORD0_TYPE(x)                         (((x) >> 13) & 0x3)
112 #define   C_SQ_CF_ALLOC_EXPORT_WORD0_TYPE                            0xFFFF9FFF
113 #define     V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PIXEL               0x00000000
114 #define     V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_POS                 0x00000001
115 #define     V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PARAM               0x00000002
116 #define     V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_SX                  0x00000003
117 #define     V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_WRITE               0x00000000
118 #define     V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_WRITE_IND           0x00000001
119 #define     V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_READ                0x00000002
120 #define     V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_READ_IND            0x00000003
121 #define   S_SQ_CF_ALLOC_EXPORT_WORD0_RW_GPR(x)                       (((unsigned)(x) & 0x7F) << 15)
122 #define   G_SQ_CF_ALLOC_EXPORT_WORD0_RW_GPR(x)                       (((x) >> 15) & 0x7F)
123 #define   C_SQ_CF_ALLOC_EXPORT_WORD0_RW_GPR                          0xFFC07FFF
124 #define   S_SQ_CF_ALLOC_EXPORT_WORD0_RW_REL(x)                       (((unsigned)(x) & 0x1) << 22)
125 #define   G_SQ_CF_ALLOC_EXPORT_WORD0_RW_REL(x)                       (((x) >> 22) & 0x1)
126 #define   C_SQ_CF_ALLOC_EXPORT_WORD0_RW_REL                          0xFFBFFFFF
127 #define   S_SQ_CF_ALLOC_EXPORT_WORD0_INDEX_GPR(x)                    (((unsigned)(x) & 0x7F) << 23)
128 #define   G_SQ_CF_ALLOC_EXPORT_WORD0_INDEX_GPR(x)                    (((x) >> 23) & 0x7F)
129 #define   C_SQ_CF_ALLOC_EXPORT_WORD0_INDEX_GPR                       0xC07FFFFF
130 #define   S_SQ_CF_ALLOC_EXPORT_WORD0_ELEM_SIZE(x)                    (((unsigned)(x) & 0x3) << 30)
131 #define   G_SQ_CF_ALLOC_EXPORT_WORD0_ELEM_SIZE(x)                    (((x) >> 30) & 0x3)
132 #define   C_SQ_CF_ALLOC_EXPORT_WORD0_ELEM_SIZE                       0x3FFFFFFF
133 #define P_SQ_CF_ALLOC_EXPORT_WORD1
134 #define   S_SQ_CF_ALLOC_EXPORT_WORD1_BURST_COUNT(x)                  (((unsigned)(x) & 0xF) << 17)
135 #define   G_SQ_CF_ALLOC_EXPORT_WORD1_BURST_COUNT(x)                  (((x) >> 17) & 0xF)
136 #define   C_SQ_CF_ALLOC_EXPORT_WORD1_BURST_COUNT                     0xFFE1FFFF
137 #define   S_SQ_CF_ALLOC_EXPORT_WORD1_END_OF_PROGRAM(x)               (((unsigned)(x) & 0x1) << 21)
138 #define   G_SQ_CF_ALLOC_EXPORT_WORD1_END_OF_PROGRAM(x)               (((x) >> 21) & 0x1)
139 #define   C_SQ_CF_ALLOC_EXPORT_WORD1_END_OF_PROGRAM                  0xFFDFFFFF
140 #define   S_SQ_CF_ALLOC_EXPORT_WORD1_VALID_PIXEL_MODE(x)             (((unsigned)(x) & 0x1) << 22)
141 #define   G_SQ_CF_ALLOC_EXPORT_WORD1_VALID_PIXEL_MODE(x)             (((x) >> 22) & 0x1)
142 #define   C_SQ_CF_ALLOC_EXPORT_WORD1_VALID_PIXEL_MODE                0xFFBFFFFF
143 #define   S_SQ_CF_ALLOC_EXPORT_WORD1_CF_INST(x)                      (((unsigned)(x) & 0x7F) << 23)
144 #define   G_SQ_CF_ALLOC_EXPORT_WORD1_CF_INST(x)                      (((x) >> 23) & 0x7F)
145 #define   C_SQ_CF_ALLOC_EXPORT_WORD1_CF_INST                         0xC07FFFFF
146 
147 #define   S_SQ_CF_ALLOC_EXPORT_WORD1_WHOLE_QUAD_MODE(x)              (((unsigned)(x) & 0x1) << 30)
148 #define   G_SQ_CF_ALLOC_EXPORT_WORD1_WHOLE_QUAD_MODE(x)              (((x) >> 30) & 0x1)
149 #define   C_SQ_CF_ALLOC_EXPORT_WORD1_WHOLE_QUAD_MODE                 0xBFFFFFFF
150 #define   S_SQ_CF_ALLOC_EXPORT_WORD1_BARRIER(x)                      (((unsigned)(x) & 0x1) << 31)
151 #define   G_SQ_CF_ALLOC_EXPORT_WORD1_BARRIER(x)                      (((x) >> 31) & 0x1)
152 #define   C_SQ_CF_ALLOC_EXPORT_WORD1_BARRIER                         0x7FFFFFFF
153 #define P_SQ_CF_ALLOC_EXPORT_WORD1_BUF
154 #define   S_SQ_CF_ALLOC_EXPORT_WORD1_BUF_ARRAY_SIZE(x)               (((unsigned)(x) & 0xFFF) << 0)
155 #define   G_SQ_CF_ALLOC_EXPORT_WORD1_BUF_ARRAY_SIZE(x)               (((x) >> 0) & 0xFFF)
156 #define   C_SQ_CF_ALLOC_EXPORT_WORD1_BUF_ARRAY_SIZE                  0xFFFFF000
157 #define   S_SQ_CF_ALLOC_EXPORT_WORD1_BUF_COMP_MASK(x)                (((unsigned)(x) & 0xF) << 12)
158 #define   G_SQ_CF_ALLOC_EXPORT_WORD1_BUF_COMP_MASK(x)                (((x) >> 12) & 0xF)
159 #define   C_SQ_CF_ALLOC_EXPORT_WORD1_BUF_COMP_MASK                   0xFFFF0FFF
160 #define P_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ
161 #define   S_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_X(x)                   (((unsigned)(x) & 0x7) << 0)
162 #define   G_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_X(x)                   (((x) >> 0) & 0x7)
163 #define   C_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_X                      0xFFFFFFF8
164 #define   S_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_Y(x)                   (((unsigned)(x) & 0x7) << 3)
165 #define   G_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_Y(x)                   (((x) >> 3) & 0x7)
166 #define   C_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_Y                      0xFFFFFFC7
167 #define   S_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_Z(x)                   (((unsigned)(x) & 0x7) << 6)
168 #define   G_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_Z(x)                   (((x) >> 6) & 0x7)
169 #define   C_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_Z                      0xFFFFFE3F
170 #define   S_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_W(x)                   (((unsigned)(x) & 0x7) << 9)
171 #define   G_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_W(x)                   (((x) >> 9) & 0x7)
172 #define   C_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_W                      0xFFFFF1FF
173 #define P_SQ_ALU_WORD0
174 #define   S_SQ_ALU_WORD0_SRC0_SEL(x)                                 (((unsigned)(x) & 0x1FF) << 0)
175 #define   G_SQ_ALU_WORD0_SRC0_SEL(x)                                 (((x) >> 0) & 0x1FF)
176 #define   C_SQ_ALU_WORD0_SRC0_SEL                                    0xFFFFFE00
177 /*
178  * 244  ALU_SRC_1_DBL_L: special constant 1.0 double-float, LSW. (RV670+)
179  * 245  ALU_SRC_1_DBL_M: special constant 1.0 double-float, MSW. (RV670+)
180  * 246  ALU_SRC_0_5_DBL_L: special constant 0.5 double-float, LSW. (RV670+)
181  * 247  ALU_SRC_0_5_DBL_M: special constant 0.5 double-float, MSW. (RV670+)
182  * 248  SQ_ALU_SRC_0: special constant 0.0.
183  * 249  SQ_ALU_SRC_1: special constant 1.0 float.
184  * 250  SQ_ALU_SRC_1_INT: special constant 1 integer.
185  * 251  SQ_ALU_SRC_M_1_INT: special constant -1 integer.
186  * 252  SQ_ALU_SRC_0_5: special constant 0.5 float.
187  * 253  SQ_ALU_SRC_LITERAL: literal constant.
188  * 254  SQ_ALU_SRC_PV: previous vector result.
189  * 255  SQ_ALU_SRC_PS: previous scalar result.
190  * 448  EG - INTERP SRC BASE
191  */
192 /* LDS are Evergreen/Cayman only */
193 #define     EG_V_SQ_ALU_SRC_LDS_OQ_A                                 0x000000DB
194 #define     EG_V_SQ_ALU_SRC_LDS_OQ_B                                 0x000000DC
195 #define     EG_V_SQ_ALU_SRC_LDS_OQ_A_POP                             0x000000DD
196 #define     EG_V_SQ_ALU_SRC_LDS_OQ_B_POP                             0x000000DE
197 #define     EG_V_SQ_ALU_SRC_LDS_DIRECT_A                             0x000000DF
198 #define     EG_V_SQ_ALU_SRC_LDS_DIRECT_B                             0x000000E0
199 
200 #define     V_SQ_ALU_SRC_0                                           0x000000F8
201 #define     V_SQ_ALU_SRC_1                                           0x000000F9
202 #define     V_SQ_ALU_SRC_1_INT                                       0x000000FA
203 #define     V_SQ_ALU_SRC_M_1_INT                                     0x000000FB
204 #define     V_SQ_ALU_SRC_0_5                                         0x000000FC
205 #define     V_SQ_ALU_SRC_LITERAL                                     0x000000FD
206 #define     V_SQ_ALU_SRC_PV                                          0x000000FE
207 #define     V_SQ_ALU_SRC_PS                                          0x000000FF
208 #define     V_SQ_ALU_SRC_PARAM_BASE                                  0x000001C0
209 #define   S_SQ_ALU_WORD0_SRC0_REL(x)                                 (((unsigned)(x) & 0x1) << 9)
210 #define   G_SQ_ALU_WORD0_SRC0_REL(x)                                 (((x) >> 9) & 0x1)
211 #define   C_SQ_ALU_WORD0_SRC0_REL                                    0xFFFFFDFF
212 #define   S_SQ_ALU_WORD0_SRC0_CHAN(x)                                (((unsigned)(x) & 0x3) << 10)
213 #define   G_SQ_ALU_WORD0_SRC0_CHAN(x)                                (((x) >> 10) & 0x3)
214 #define   C_SQ_ALU_WORD0_SRC0_CHAN                                   0xFFFFF3FF
215 #define   S_SQ_ALU_WORD0_SRC0_NEG(x)                                 (((unsigned)(x) & 0x1) << 12)
216 #define   G_SQ_ALU_WORD0_SRC0_NEG(x)                                 (((x) >> 12) & 0x1)
217 #define   C_SQ_ALU_WORD0_SRC0_NEG                                    0xFFFFEFFF
218 #define   S_SQ_ALU_WORD0_SRC1_SEL(x)                                 (((unsigned)(x) & 0x1FF) << 13)
219 #define   G_SQ_ALU_WORD0_SRC1_SEL(x)                                 (((x) >> 13) & 0x1FF)
220 #define   C_SQ_ALU_WORD0_SRC1_SEL                                    0xFFC01FFF
221 #define   S_SQ_ALU_WORD0_SRC1_REL(x)                                 (((unsigned)(x) & 0x1) << 22)
222 #define   G_SQ_ALU_WORD0_SRC1_REL(x)                                 (((x) >> 22) & 0x1)
223 #define   C_SQ_ALU_WORD0_SRC1_REL                                    0xFFBFFFFF
224 #define   S_SQ_ALU_WORD0_SRC1_CHAN(x)                                (((unsigned)(x) & 0x3) << 23)
225 #define   G_SQ_ALU_WORD0_SRC1_CHAN(x)                                (((x) >> 23) & 0x3)
226 #define   C_SQ_ALU_WORD0_SRC1_CHAN                                   0xFE7FFFFF
227 #define   S_SQ_ALU_WORD0_SRC1_NEG(x)                                 (((unsigned)(x) & 0x1) << 25)
228 #define   G_SQ_ALU_WORD0_SRC1_NEG(x)                                 (((x) >> 25) & 0x1)
229 #define   C_SQ_ALU_WORD0_SRC1_NEG                                    0xFDFFFFFF
230 #define   S_SQ_ALU_WORD0_INDEX_MODE(x)                               (((unsigned)(x) & 0x7) << 26)
231 #define   G_SQ_ALU_WORD0_INDEX_MODE(x)                               (((x) >> 26) & 0x7)
232 #define   C_SQ_ALU_WORD0_INDEX_MODE                                  0xE3FFFFFF
233 #define   S_SQ_ALU_WORD0_PRED_SEL(x)                                 (((unsigned)(x) & 0x3) << 29)
234 #define   G_SQ_ALU_WORD0_PRED_SEL(x)                                 (((x) >> 29) & 0x3)
235 #define   C_SQ_ALU_WORD0_PRED_SEL                                    0x9FFFFFFF
236 #define   S_SQ_ALU_WORD0_LAST(x)                                     (((unsigned)(x) & 0x1) << 31)
237 #define   G_SQ_ALU_WORD0_LAST(x)                                     (((x) >> 31) & 0x1)
238 #define   C_SQ_ALU_WORD0_LAST                                        0x7FFFFFFF
239 #define P_SQ_ALU_WORD1
240 #define   S_SQ_ALU_WORD1_ENCODING(x)                                 (((unsigned)(x) & 0x7) << 15)
241 #define   G_SQ_ALU_WORD1_ENCODING(x)                                 (((x) >> 15) & 0x7)
242 #define   C_SQ_ALU_WORD1_ENCODING                                    0xFFFC7FFF
243 #define   S_SQ_ALU_WORD1_BANK_SWIZZLE(x)                             (((unsigned)(x) & 0x7) << 18)
244 #define   G_SQ_ALU_WORD1_BANK_SWIZZLE(x)                             (((x) >> 18) & 0x7)
245 #define   C_SQ_ALU_WORD1_BANK_SWIZZLE                                0xFFE3FFFF
246 #define   S_SQ_ALU_WORD1_DST_GPR(x)                                  (((unsigned)(x) & 0x7F) << 21)
247 #define   G_SQ_ALU_WORD1_DST_GPR(x)                                  (((x) >> 21) & 0x7F)
248 #define   C_SQ_ALU_WORD1_DST_GPR                                     0xF01FFFFF
249 #define   S_SQ_ALU_WORD1_DST_REL(x)                                  (((unsigned)(x) & 0x1) << 28)
250 #define   G_SQ_ALU_WORD1_DST_REL(x)                                  (((x) >> 28) & 0x1)
251 #define   C_SQ_ALU_WORD1_DST_REL                                     0xEFFFFFFF
252 #define   S_SQ_ALU_WORD1_DST_CHAN(x)                                 (((unsigned)(x) & 0x3) << 29)
253 #define   G_SQ_ALU_WORD1_DST_CHAN(x)                                 (((x) >> 29) & 0x3)
254 #define   C_SQ_ALU_WORD1_DST_CHAN                                    0x9FFFFFFF
255 #define   S_SQ_ALU_WORD1_CLAMP(x)                                    (((unsigned)(x) & 0x1) << 31)
256 #define   G_SQ_ALU_WORD1_CLAMP(x)                                    (((x) >> 31) & 0x1)
257 #define   C_SQ_ALU_WORD1_CLAMP                                       0x7FFFFFFF
258 #define P_SQ_ALU_WORD1_OP2
259 #define   S_SQ_ALU_WORD1_OP2_SRC0_ABS(x)                             (((unsigned)(x) & 0x1) << 0)
260 #define   G_SQ_ALU_WORD1_OP2_SRC0_ABS(x)                             (((x) >> 0) & 0x1)
261 #define   C_SQ_ALU_WORD1_OP2_SRC0_ABS                                0xFFFFFFFE
262 #define   S_SQ_ALU_WORD1_OP2_SRC1_ABS(x)                             (((unsigned)(x) & 0x1) << 1)
263 #define   G_SQ_ALU_WORD1_OP2_SRC1_ABS(x)                             (((x) >> 1) & 0x1)
264 #define   C_SQ_ALU_WORD1_OP2_SRC1_ABS                                0xFFFFFFFD
265 #define   S_SQ_ALU_WORD1_OP2_UPDATE_EXECUTE_MASK(x)                  (((unsigned)(x) & 0x1) << 2)
266 #define   G_SQ_ALU_WORD1_OP2_UPDATE_EXECUTE_MASK(x)                  (((x) >> 2) & 0x1)
267 #define   C_SQ_ALU_WORD1_OP2_UPDATE_EXECUTE_MASK                     0xFFFFFFFB
268 #define   S_SQ_ALU_WORD1_OP2_UPDATE_PRED(x)                          (((unsigned)(x) & 0x1) << 3)
269 #define   G_SQ_ALU_WORD1_OP2_UPDATE_PRED(x)                          (((x) >> 3) & 0x1)
270 #define   C_SQ_ALU_WORD1_OP2_UPDATE_PRED                             0xFFFFFFF7
271 #define   S_SQ_ALU_WORD1_OP2_WRITE_MASK(x)                           (((unsigned)(x) & 0x1) << 4)
272 #define   G_SQ_ALU_WORD1_OP2_WRITE_MASK(x)                           (((x) >> 4) & 0x1)
273 #define   C_SQ_ALU_WORD1_OP2_WRITE_MASK                              0xFFFFFFEF
274 #define   S_SQ_ALU_WORD1_OP2_FOG_MERGE(x)                            (((unsigned)(x) & 0x1) << 5)
275 #define   G_SQ_ALU_WORD1_OP2_FOG_MERGE(x)                            (((x) >> 5) & 0x1)
276 #define   C_SQ_ALU_WORD1_OP2_FOG_MERGE                               0xFFFFFFDF
277 #define   S_SQ_ALU_WORD1_OP2_OMOD(x)                                 (((unsigned)(x) & 0x3) << 6)
278 #define   G_SQ_ALU_WORD1_OP2_OMOD(x)                                 (((x) >> 6) & 0x3)
279 #define   C_SQ_ALU_WORD1_OP2_OMOD                                    0xFFFFFF3F
280 #define   S_SQ_ALU_WORD1_OP2_ALU_INST(x)                             (((unsigned)(x) & 0x3FF) << 8)
281 #define   G_SQ_ALU_WORD1_OP2_ALU_INST(x)                             (((x) >> 8) & 0x3FF)
282 #define   C_SQ_ALU_WORD1_OP2_ALU_INST                                0xFFFC00FF
283 #define P_SQ_ALU_WORD1_OP3
284 #define   S_SQ_ALU_WORD1_OP3_SRC2_SEL(x)                             (((unsigned)(x) & 0x1FF) << 0)
285 #define   G_SQ_ALU_WORD1_OP3_SRC2_SEL(x)                             (((x) >> 0) & 0x1FF)
286 #define   C_SQ_ALU_WORD1_OP3_SRC2_SEL                                0xFFFFFE00
287 #define   S_SQ_ALU_WORD1_OP3_SRC2_REL(x)                             (((unsigned)(x) & 0x1) << 9)
288 #define   G_SQ_ALU_WORD1_OP3_SRC2_REL(x)                             (((x) >> 9) & 0x1)
289 #define   C_SQ_ALU_WORD1_OP3_SRC2_REL                                0xFFFFFDFF
290 #define   S_SQ_ALU_WORD1_OP3_SRC2_CHAN(x)                            (((unsigned)(x) & 0x3) << 10)
291 #define   G_SQ_ALU_WORD1_OP3_SRC2_CHAN(x)                            (((x) >> 10) & 0x3)
292 #define   C_SQ_ALU_WORD1_OP3_SRC2_CHAN                               0xFFFFF3FF
293 #define   S_SQ_ALU_WORD1_OP3_SRC2_NEG(x)                             (((unsigned)(x) & 0x1) << 12)
294 #define   G_SQ_ALU_WORD1_OP3_SRC2_NEG(x)                             (((x) >> 12) & 0x1)
295 #define   C_SQ_ALU_WORD1_OP3_SRC2_NEG                                0xFFFFEFFF
296 #define   S_SQ_ALU_WORD1_OP3_ALU_INST(x)                             (((unsigned)(x) & 0x1F) << 13)
297 #define   G_SQ_ALU_WORD1_OP3_ALU_INST(x)                             (((x) >> 13) & 0x1F)
298 #define   C_SQ_ALU_WORD1_OP3_ALU_INST                                0xFFFC1FFF
299 #define P_SQ_VTX_WORD0
300 #define   S_SQ_VTX_WORD0_VTX_INST(x)                                 (((unsigned)(x) & 0x1F) << 0)
301 #define   G_SQ_VTX_WORD0_VTX_INST(x)                                 (((x) >> 0) & 0x1F)
302 #define   C_SQ_VTX_WORD0_VTX_INST                                    0xFFFFFFE0
303 #define   S_SQ_VTX_WORD0_FETCH_TYPE(x)                               (((unsigned)(x) & 0x3) << 5)
304 #define   G_SQ_VTX_WORD0_FETCH_TYPE(x)                               (((x) >> 5) & 0x3)
305 #define   C_SQ_VTX_WORD0_FETCH_TYPE                                  0xFFFFFF9F
306 #define   S_SQ_VTX_WORD0_FETCH_WHOLE_QUAD(x)                         (((unsigned)(x) & 0x1) << 7)
307 #define   G_SQ_VTX_WORD0_FETCH_WHOLE_QUAD(x)                         (((x) >> 7) & 0x1)
308 #define   C_SQ_VTX_WORD0_FETCH_WHOLE_QUAD                            0xFFFFFF7F
309 #define   S_SQ_VTX_WORD0_BUFFER_ID(x)                                (((unsigned)(x) & 0xFF) << 8)
310 #define   G_SQ_VTX_WORD0_BUFFER_ID(x)                                (((x) >> 8) & 0xFF)
311 #define   C_SQ_VTX_WORD0_BUFFER_ID                                   0xFFFF00FF
312 #define   S_SQ_VTX_WORD0_SRC_GPR(x)                                  (((unsigned)(x) & 0x7F) << 16)
313 #define   G_SQ_VTX_WORD0_SRC_GPR(x)                                  (((x) >> 16) & 0x7F)
314 #define   C_SQ_VTX_WORD0_SRC_GPR                                     0xFF80FFFF
315 #define   S_SQ_VTX_WORD0_SRC_REL(x)                                  (((unsigned)(x) & 0x1) << 23)
316 #define   G_SQ_VTX_WORD0_SRC_REL(x)                                  (((x) >> 23) & 0x1)
317 #define   C_SQ_VTX_WORD0_SRC_REL                                     0xFF7FFFFF
318 #define   S_SQ_VTX_WORD0_SRC_SEL_X(x)                                (((unsigned)(x) & 0x3) << 24)
319 #define   G_SQ_VTX_WORD0_SRC_SEL_X(x)                                (((x) >> 24) & 0x3)
320 #define   C_SQ_VTX_WORD0_SRC_SEL_X                                   0xFCFFFFFF
321 #define   S_SQ_VTX_WORD0_MEGA_FETCH_COUNT(x)                         (((unsigned)(x) & 0x3F) << 26)
322 #define   G_SQ_VTX_WORD0_MEGA_FETCH_COUNT(x)                         (((x) >> 26) & 0x3F)
323 #define   C_SQ_VTX_WORD0_MEGA_FETCH_COUNT                            0x03FFFFFF
324 #define P_SQ_VTX_WORD1
325 #define   S_SQ_VTX_WORD1_DST_SEL_X(x)                                (((unsigned)(x) & 0x7) << 9)
326 #define   G_SQ_VTX_WORD1_DST_SEL_X(x)                                (((x) >> 9) & 0x7)
327 #define   C_SQ_VTX_WORD1_DST_SEL_X                                   0xFFFFF1FF
328 #define   S_SQ_VTX_WORD1_DST_SEL_Y(x)                                (((unsigned)(x) & 0x7) << 12)
329 #define   G_SQ_VTX_WORD1_DST_SEL_Y(x)                                (((x) >> 12) & 0x7)
330 #define   C_SQ_VTX_WORD1_DST_SEL_Y                                   0xFFFF8FFF
331 #define   S_SQ_VTX_WORD1_DST_SEL_Z(x)                                (((unsigned)(x) & 0x7) << 15)
332 #define   G_SQ_VTX_WORD1_DST_SEL_Z(x)                                (((x) >> 15) & 0x7)
333 #define   C_SQ_VTX_WORD1_DST_SEL_Z                                   0xFFFC7FFF
334 #define   S_SQ_VTX_WORD1_DST_SEL_W(x)                                (((unsigned)(x) & 0x7) << 18)
335 #define   G_SQ_VTX_WORD1_DST_SEL_W(x)                                (((x) >> 18) & 0x7)
336 #define   C_SQ_VTX_WORD1_DST_SEL_W                                   0xFFE3FFFF
337 #define   S_SQ_VTX_WORD1_USE_CONST_FIELDS(x)                         (((unsigned)(x) & 0x1) << 21)
338 #define   G_SQ_VTX_WORD1_USE_CONST_FIELDS(x)                         (((x) >> 21) & 0x1)
339 #define   C_SQ_VTX_WORD1_USE_CONST_FIELDS                            0xFFDFFFFF
340 #define   S_SQ_VTX_WORD1_DATA_FORMAT(x)                              (((unsigned)(x) & 0x3F) << 22)
341 #define   G_SQ_VTX_WORD1_DATA_FORMAT(x)                              (((x) >> 22) & 0x3F)
342 #define   C_SQ_VTX_WORD1_DATA_FORMAT                                 0xF03FFFFF
343 #define   S_SQ_VTX_WORD1_NUM_FORMAT_ALL(x)                           (((unsigned)(x) & 0x3) << 28)
344 #define   G_SQ_VTX_WORD1_NUM_FORMAT_ALL(x)                           (((x) >> 28) & 0x3)
345 #define   C_SQ_VTX_WORD1_NUM_FORMAT_ALL                              0xCFFFFFFF
346 #define   S_SQ_VTX_WORD1_FORMAT_COMP_ALL(x)                          (((unsigned)(x) & 0x1) << 30)
347 #define   G_SQ_VTX_WORD1_FORMAT_COMP_ALL(x)                          (((x) >> 30) & 0x1)
348 #define   C_SQ_VTX_WORD1_FORMAT_COMP_ALL                             0xBFFFFFFF
349 #define   S_SQ_VTX_WORD1_SRF_MODE_ALL(x)                             (((unsigned)(x) & 0x1) << 31)
350 #define   G_SQ_VTX_WORD1_SRF_MODE_ALL(x)                             (((x) >> 31) & 0x1)
351 #define   C_SQ_VTX_WORD1_SRF_MODE_ALL                                0x7FFFFFFF
352 #define P_SQ_VTX_WORD1_GPR
353 #define   S_SQ_VTX_WORD1_GPR_DST_GPR(x)                              (((unsigned)(x) & 0x7F) << 0)
354 #define   G_SQ_VTX_WORD1_GPR_DST_GPR(x)                              (((x) >> 0) & 0x7F)
355 #define   C_SQ_VTX_WORD1_GPR_DST_GPR                                 0xFFFFFF80
356 #define   S_SQ_VTX_WORD1_GPR_DST_REL(x)                              (((unsigned)(x) & 0x1) << 7)
357 #define   G_SQ_VTX_WORD1_GPR_DST_REL(x)                              (((x) >> 7) & 0x1)
358 #define   C_SQ_VTX_WORD1_GPR_DST_REL                                 0xFFFFFF7F
359 #define P_SQ_VTX_WORD1_SEM
360 #define   S_SQ_VTX_WORD1_SEM_SEMANTIC_ID(x)                          (((unsigned)(x) & 0xFF) << 0)
361 #define   G_SQ_VTX_WORD1_SEM_SEMANTIC_ID(x)                          (((x) >> 0) & 0xFF)
362 #define   C_SQ_VTX_WORD1_SEM_SEMANTIC_ID                             0xFFFFFF00
363 #define P_SQ_VTX_WORD2
364 #define   S_SQ_VTX_WORD2_OFFSET(x)                                   (((unsigned)(x) & 0xFFFF) << 0)
365 #define   G_SQ_VTX_WORD2_OFFSET(x)                                   (((x) >> 0) & 0xFFFF)
366 #define   C_SQ_VTX_WORD2_OFFSET                                      0xFFFF0000
367 #define   S_SQ_VTX_WORD2_ENDIAN_SWAP(x)                              (((unsigned)(x) & 0x3) << 16)
368 #define   G_SQ_VTX_WORD2_ENDIAN_SWAP(x)                              (((x) >> 16) & 0x3)
369 #define   C_SQ_VTX_WORD2_ENDIAN_SWAP                                 0xFFFCFFFF
370 #define   S_SQ_VTX_WORD2_CONST_BUF_NO_STRIDE(x)                      (((unsigned)(x) & 0x1) << 18)
371 #define   G_SQ_VTX_WORD2_CONST_BUF_NO_STRIDE(x)                      (((x) >> 18) & 0x1)
372 #define   C_SQ_VTX_WORD2_CONST_BUF_NO_STRIDE                         0xFFFBFFFF
373 #define   S_SQ_VTX_WORD2_MEGA_FETCH(x)                               (((unsigned)(x) & 0x1) << 19)
374 #define   G_SQ_VTX_WORD2_MEGA_FETCH(x)                               (((x) >> 19) & 0x1)
375 #define   C_SQ_VTX_WORD2_MEGA_FETCH                                  0xFFF7FFFF
376 #define   S_SQ_VTX_WORD2_ALT_CONST(x)                                (((unsigned)(x) & 0x1) << 20)
377 #define   G_SQ_VTX_WORD2_ALT_CONST(x)                                (((x) >> 20) & 0x1)
378 #define   C_SQ_VTX_WORD2_ALT_CONST                                   0xFFEFFFFF
379 #define P_SQ_TEX_WORD0
380 #define   S_SQ_TEX_WORD0_TEX_INST(x)                                 (((unsigned)(x) & 0x1F) << 0)
381 #define   G_SQ_TEX_WORD0_TEX_INST(x)                                 (((x) >> 0) & 0x1F)
382 #define   C_SQ_TEX_WORD0_TEX_INST                                    0xFFFFFFE0
383 #define   S_SQ_TEX_WORD0_BC_FRAC_MODE(x)                             (((unsigned)(x) & 0x1) << 5)
384 #define   G_SQ_TEX_WORD0_BC_FRAC_MODE(x)                             (((x) >> 5) & 0x1)
385 #define   C_SQ_TEX_WORD0_BC_FRAC_MODE                                0xFFFFFFDF
386 #define   EG_S_SQ_TEX_WORD0_INST_MOD(x)                                 (((unsigned)(x) & 0x3) << 5)
387 #define   EG_G_SQ_TEX_WORD0_INST_MOD(x)                                 (((x) >> 5) & 0x3)
388 #define   EG_C_SQ_TEX_WORD0_INST_MOD                                    0xFFFFFF9F
389 #define   S_SQ_TEX_WORD0_FETCH_WHOLE_QUAD(x)                         (((unsigned)(x) & 0x1) << 7)
390 #define   G_SQ_TEX_WORD0_FETCH_WHOLE_QUAD(x)                         (((x) >> 7) & 0x1)
391 #define   C_SQ_TEX_WORD0_FETCH_WHOLE_QUAD                            0xFFFFFF7F
392 #define   S_SQ_TEX_WORD0_RESOURCE_ID(x)                              (((unsigned)(x) & 0xFF) << 8)
393 #define   G_SQ_TEX_WORD0_RESOURCE_ID(x)                              (((x) >> 8) & 0xFF)
394 #define   C_SQ_TEX_WORD0_RESOURCE_ID                                 0xFFFF00FF
395 #define   S_SQ_TEX_WORD0_SRC_GPR(x)                                  (((unsigned)(x) & 0x7F) << 16)
396 #define   G_SQ_TEX_WORD0_SRC_GPR(x)                                  (((x) >> 16) & 0x7F)
397 #define   C_SQ_TEX_WORD0_SRC_GPR                                     0xFF80FFFF
398 #define   S_SQ_TEX_WORD0_SRC_REL(x)                                  (((unsigned)(x) & 0x1) << 23)
399 #define   G_SQ_TEX_WORD0_SRC_REL(x)                                  (((x) >> 23) & 0x1)
400 #define   C_SQ_TEX_WORD0_SRC_REL                                     0xFF7FFFFF
401 #define   S_SQ_TEX_WORD0_ALT_CONST(x)                                (((unsigned)(x) & 0x1) << 24)
402 #define   G_SQ_TEX_WORD0_ALT_CONST(x)                                (((x) >> 24) & 0x1)
403 #define   C_SQ_TEX_WORD0_ALT_CONST                                   0xFEFFFFFF
404 #define P_SQ_TEX_WORD1
405 #define   S_SQ_TEX_WORD1_DST_GPR(x)                                  (((unsigned)(x) & 0x7F) << 0)
406 #define   G_SQ_TEX_WORD1_DST_GPR(x)                                  (((x) >> 0) & 0x7F)
407 #define   C_SQ_TEX_WORD1_DST_GPR                                     0xFFFFFF80
408 #define   S_SQ_TEX_WORD1_DST_REL(x)                                  (((unsigned)(x) & 0x1) << 7)
409 #define   G_SQ_TEX_WORD1_DST_REL(x)                                  (((x) >> 7) & 0x1)
410 #define   C_SQ_TEX_WORD1_DST_REL                                     0xFFFFFF7F
411 #define   S_SQ_TEX_WORD1_DST_SEL_X(x)                                (((unsigned)(x) & 0x7) << 9)
412 #define   G_SQ_TEX_WORD1_DST_SEL_X(x)                                (((x) >> 9) & 0x7)
413 #define   C_SQ_TEX_WORD1_DST_SEL_X                                   0xFFFFF1FF
414 #define   S_SQ_TEX_WORD1_DST_SEL_Y(x)                                (((unsigned)(x) & 0x7) << 12)
415 #define   G_SQ_TEX_WORD1_DST_SEL_Y(x)                                (((x) >> 12) & 0x7)
416 #define   C_SQ_TEX_WORD1_DST_SEL_Y                                   0xFFFF8FFF
417 #define   S_SQ_TEX_WORD1_DST_SEL_Z(x)                                (((unsigned)(x) & 0x7) << 15)
418 #define   G_SQ_TEX_WORD1_DST_SEL_Z(x)                                (((x) >> 15) & 0x7)
419 #define   C_SQ_TEX_WORD1_DST_SEL_Z                                   0xFFFC7FFF
420 #define   S_SQ_TEX_WORD1_DST_SEL_W(x)                                (((unsigned)(x) & 0x7) << 18)
421 #define   G_SQ_TEX_WORD1_DST_SEL_W(x)                                (((x) >> 18) & 0x7)
422 #define   C_SQ_TEX_WORD1_DST_SEL_W                                   0xFFE3FFFF
423 #define   S_SQ_TEX_WORD1_LOD_BIAS(x)                                 (((unsigned)(x) & 0x7F) << 21)
424 #define   G_SQ_TEX_WORD1_LOD_BIAS(x)                                 (((x) >> 21) & 0x7F)
425 #define   C_SQ_TEX_WORD1_LOD_BIAS                                    0xF01FFFFF
426 #define   S_SQ_TEX_WORD1_COORD_TYPE_X(x)                             (((unsigned)(x) & 0x1) << 28)
427 #define   G_SQ_TEX_WORD1_COORD_TYPE_X(x)                             (((x) >> 28) & 0x1)
428 #define   C_SQ_TEX_WORD1_COORD_TYPE_X                                0xEFFFFFFF
429 #define     V_SQ_TEX_WORD1_COORD_UNNORMALIZED                        0x00000000
430 #define     V_SQ_TEX_WORD1_COORD_NORMALIZED                          0x00000001
431 #define   S_SQ_TEX_WORD1_COORD_TYPE_Y(x)                             (((unsigned)(x) & 0x1) << 29)
432 #define   G_SQ_TEX_WORD1_COORD_TYPE_Y(x)                             (((x) >> 29) & 0x1)
433 #define   C_SQ_TEX_WORD1_COORD_TYPE_Y                                0xDFFFFFFF
434 #define   S_SQ_TEX_WORD1_COORD_TYPE_Z(x)                             (((unsigned)(x) & 0x1) << 30)
435 #define   G_SQ_TEX_WORD1_COORD_TYPE_Z(x)                             (((x) >> 30) & 0x1)
436 #define   C_SQ_TEX_WORD1_COORD_TYPE_Z                                0xBFFFFFFF
437 #define   S_SQ_TEX_WORD1_COORD_TYPE_W(x)                             (((unsigned)(x) & 0x1) << 31)
438 #define   G_SQ_TEX_WORD1_COORD_TYPE_W(x)                             (((x) >> 31) & 0x1)
439 #define   C_SQ_TEX_WORD1_COORD_TYPE_W                                0x7FFFFFFF
440 #define P_SQ_TEX_WORD2
441 #define   S_SQ_TEX_WORD2_OFFSET_X(x)                                 (((unsigned)(x) & 0x1F) << 0)
442 #define   G_SQ_TEX_WORD2_OFFSET_X(x)                                 (((x) >> 0) & 0x1F)
443 #define   C_SQ_TEX_WORD2_OFFSET_X                                    0xFFFFFFE0
444 #define   S_SQ_TEX_WORD2_OFFSET_Y(x)                                 (((unsigned)(x) & 0x1F) << 5)
445 #define   G_SQ_TEX_WORD2_OFFSET_Y(x)                                 (((x) >> 5) & 0x1F)
446 #define   C_SQ_TEX_WORD2_OFFSET_Y                                    0xFFFFFC1F
447 #define   S_SQ_TEX_WORD2_OFFSET_Z(x)                                 (((unsigned)(x) & 0x1F) << 10)
448 #define   G_SQ_TEX_WORD2_OFFSET_Z(x)                                 (((x) >> 10) & 0x1F)
449 #define   C_SQ_TEX_WORD2_OFFSET_Z                                    0xFFFF83FF
450 #define   S_SQ_TEX_WORD2_SAMPLER_ID(x)                               (((unsigned)(x) & 0x1F) << 15)
451 #define   G_SQ_TEX_WORD2_SAMPLER_ID(x)                               (((x) >> 15) & 0x1F)
452 #define   C_SQ_TEX_WORD2_SAMPLER_ID                                  0xFFF07FFF
453 #define   S_SQ_TEX_WORD2_SRC_SEL_X(x)                                (((unsigned)(x) & 0x7) << 20)
454 #define   G_SQ_TEX_WORD2_SRC_SEL_X(x)                                (((x) >> 20) & 0x7)
455 #define   C_SQ_TEX_WORD2_SRC_SEL_X                                   0xFF8FFFFF
456 #define   S_SQ_TEX_WORD2_SRC_SEL_Y(x)                                (((unsigned)(x) & 0x7) << 23)
457 #define   G_SQ_TEX_WORD2_SRC_SEL_Y(x)                                (((x) >> 23) & 0x7)
458 #define   C_SQ_TEX_WORD2_SRC_SEL_Y                                   0xFC7FFFFF
459 #define   S_SQ_TEX_WORD2_SRC_SEL_Z(x)                                (((unsigned)(x) & 0x7) << 26)
460 #define   G_SQ_TEX_WORD2_SRC_SEL_Z(x)                                (((x) >> 26) & 0x7)
461 #define   C_SQ_TEX_WORD2_SRC_SEL_Z                                   0xE3FFFFFF
462 #define   S_SQ_TEX_WORD2_SRC_SEL_W(x)                                (((unsigned)(x) & 0x7) << 29)
463 #define   G_SQ_TEX_WORD2_SRC_SEL_W(x)                                (((x) >> 29) & 0x7)
464 #define   C_SQ_TEX_WORD2_SRC_SEL_W                                   0x1FFFFFFF
465 
466 #define V_SQ_CF_COND_ACTIVE                             0x00
467 #define V_SQ_CF_COND_FALSE                              0x01
468 #define V_SQ_CF_COND_BOOL                               0x02
469 #define V_SQ_CF_COND_NOT_BOOL                           0x03
470 
471 #define V_SQ_REL_ABSOLUTE 0
472 #define V_SQ_REL_RELATIVE 1
473 
474 #define SQ_ALU_VEC_012                                0x00
475 #define SQ_ALU_VEC_021                                0x01
476 #define SQ_ALU_VEC_120                                0x02
477 #define SQ_ALU_VEC_102                                0x03
478 #define SQ_ALU_VEC_201                                0x04
479 #define SQ_ALU_VEC_210                                0x05
480 
481 #define SQ_ALU_SCL_210                           0x00000000
482 #define SQ_ALU_SCL_122                           0x00000001
483 #define SQ_ALU_SCL_212                           0x00000002
484 #define SQ_ALU_SCL_221                           0x00000003
485 
486 #define   INDEX_MODE_AR_X 0
487 #define   INDEX_MODE_AR_Y 1
488 #define   INDEX_MODE_AR_Z 2
489 #define   INDEX_MODE_AR_W 3
490 #define   INDEX_MODE_LOOP 4
491 
492 #define SQ_VTX_FETCH_VERTEX_DATA 0
493 #define SQ_VTX_FETCH_INSTANCE_DATA 1
494 #define SQ_VTX_FETCH_NO_INDEX_OFFSET 2
495 
496 #endif
497