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 EG_SQ_H 27 #define EG_SQ_H 28 29 #define P_SQ_CF_WORD0 30 #define S_SQ_CF_WORD0_ADDR(x) (((unsigned)(x) & 0xFFFFFF) << 0) 31 #define G_SQ_CF_WORD0_ADDR(x) (((x) >> 0) & 0xFFFFFF) 32 #define C_SQ_CF_WORD0_ADDR 0x00000000 33 #define S_SQ_CF_WORD0_JUMPTABLE_SEL(x) (((unsigned)(x) & 0x7) << 24) 34 #define G_SQ_CF_WORD0_JUMPTABLE_SEL(x) (((x) >> 24) & 0x7) 35 #define C_SQ_CF_WORD0_JUMPTABLE_SEL 0xF8FFFFFF 36 #define P_SQ_CF_WORD1 37 #define S_SQ_CF_WORD1_POP_COUNT(x) (((unsigned)(x) & 0x7) << 0) 38 #define G_SQ_CF_WORD1_POP_COUNT(x) (((x) >> 0) & 0x7) 39 #define C_SQ_CF_WORD1_POP_COUNT 0xFFFFFFF8 40 #define S_SQ_CF_WORD1_CF_CONST(x) (((unsigned)(x) & 0x1F) << 3) 41 #define G_SQ_CF_WORD1_CF_CONST(x) (((x) >> 3) & 0x1F) 42 #define C_SQ_CF_WORD1_CF_CONST 0xFFFFFF07 43 #define S_SQ_CF_WORD1_COND(x) (((unsigned)(x) & 0x3) << 8) 44 #define G_SQ_CF_WORD1_COND(x) (((x) >> 8) & 0x3) 45 #define C_SQ_CF_WORD1_COND 0xFFFFFCFF 46 #define S_SQ_CF_WORD1_COUNT(x) (((unsigned)(x) & 0x3f) << 10) 47 #define G_SQ_CF_WORD1_COUNT(x) (((x) >> 10) & 0x3f) 48 #define C_SQ_CF_WORD1_COUNT 0xFFFF03FF 49 #define S_SQ_CF_WORD1_VALID_PIXEL_MODE(x) (((unsigned)(x) & 0x1) << 20) 50 #define G_SQ_CF_WORD1_VALID_PIXEL_MODE(x) (((x) >> 20) & 0x1) 51 #define C_SQ_CF_WORD1_VALID_PIXEL_MODE 0xFFEFFFFF 52 #define S_SQ_CF_WORD1_END_OF_PROGRAM(x) (((unsigned)(x) & 0x1) << 21) 53 #define G_SQ_CF_WORD1_END_OF_PROGRAM(x) (((x) >> 21) & 0x1) 54 #define C_SQ_CF_WORD1_END_OF_PROGRAM 0xFFDFFFFF 55 56 #define S_SQ_CF_WORD1_CF_INST(x) (((unsigned)(x) & 0xFF) << 22) 57 #define G_SQ_CF_WORD1_CF_INST(x) (((x) >> 22) & 0xFF) 58 #define C_SQ_CF_WORD1_CF_INST 0xC03FFFFF 59 60 #define S_SQ_CF_WORD1_WHOLE_QUAD_MODE(x) (((unsigned)(x) & 0x1) << 30) 61 #define G_SQ_CF_WORD1_WHOLE_QUAD_MODE(x) (((x) >> 30) & 0x1) 62 #define C_SQ_CF_WORD1_WHOLE_QUAD_MODE 0xBFFFFFFF 63 #define S_SQ_CF_WORD1_BARRIER(x) (((unsigned)(x) & 0x1) << 31) 64 #define G_SQ_CF_WORD1_BARRIER(x) (((x) >> 31) & 0x1) 65 #define C_SQ_CF_WORD1_BARRIER 0x7FFFFFFF 66 67 /* done */ 68 #define P_SQ_CF_ALU_WORD0 69 #define S_SQ_CF_ALU_WORD0_ADDR(x) (((unsigned)(x) & 0x3FFFFF) << 0) 70 #define G_SQ_CF_ALU_WORD0_ADDR(x) (((x) >> 0) & 0x3FFFFF) 71 #define C_SQ_CF_ALU_WORD0_ADDR 0xFFC00000 72 #define S_SQ_CF_ALU_WORD0_KCACHE_BANK0(x) (((unsigned)(x) & 0xF) << 22) 73 #define G_SQ_CF_ALU_WORD0_KCACHE_BANK0(x) (((x) >> 22) & 0xF) 74 #define C_SQ_CF_ALU_WORD0_KCACHE_BANK0 0xFC3FFFFF 75 #define S_SQ_CF_ALU_WORD0_KCACHE_BANK1(x) (((unsigned)(x) & 0xF) << 26) 76 #define G_SQ_CF_ALU_WORD0_KCACHE_BANK1(x) (((x) >> 26) & 0xF) 77 #define C_SQ_CF_ALU_WORD0_KCACHE_BANK1 0xC3FFFFFF 78 #define S_SQ_CF_ALU_WORD0_KCACHE_MODE0(x) (((unsigned)(x) & 0x3) << 30) 79 #define G_SQ_CF_ALU_WORD0_KCACHE_MODE0(x) (((x) >> 30) & 0x3) 80 #define C_SQ_CF_ALU_WORD0_KCACHE_MODE0 0x3FFFFFFF 81 #define V_SQ_CF_KCACHE_NOP 0x00000000 82 #define V_SQ_CF_KCACHE_LOCK_1 0x00000001 83 #define V_SQ_CF_KCACHE_LOCK_2 0x00000002 84 #define V_SQ_CF_KCACHE_LOCK_LOOP_INDEX 0x00000003 85 #define P_SQ_CF_ALU_WORD1 86 #define S_SQ_CF_ALU_WORD1_KCACHE_MODE1(x) (((unsigned)(x) & 0x3) << 0) 87 #define G_SQ_CF_ALU_WORD1_KCACHE_MODE1(x) (((x) >> 0) & 0x3) 88 #define C_SQ_CF_ALU_WORD1_KCACHE_MODE1 0xFFFFFFFC 89 #define S_SQ_CF_ALU_WORD1_KCACHE_ADDR0(x) (((unsigned)(x) & 0xFF) << 2) 90 #define G_SQ_CF_ALU_WORD1_KCACHE_ADDR0(x) (((x) >> 2) & 0xFF) 91 #define C_SQ_CF_ALU_WORD1_KCACHE_ADDR0 0xFFFFFC03 92 #define S_SQ_CF_ALU_WORD1_KCACHE_ADDR1(x) (((unsigned)(x) & 0xFF) << 10) 93 #define G_SQ_CF_ALU_WORD1_KCACHE_ADDR1(x) (((x) >> 10) & 0xFF) 94 #define C_SQ_CF_ALU_WORD1_KCACHE_ADDR1 0xFFFC03FF 95 #define S_SQ_CF_ALU_WORD1_COUNT(x) (((unsigned)(x) & 0x7F) << 18) 96 #define G_SQ_CF_ALU_WORD1_COUNT(x) (((x) >> 18) & 0x7F) 97 #define C_SQ_CF_ALU_WORD1_COUNT 0xFE03FFFF 98 #define S_SQ_CF_ALU_WORD1_ALT_CONST(x) (((unsigned)(x) & 0x1) << 25) 99 #define G_SQ_CF_ALU_WORD1_ALT_CONST(x) (((x) >> 25) & 0x1) 100 #define C_SQ_CF_ALU_WORD1_ALT_CONST 0xFDFFFFFF 101 #define S_SQ_CF_ALU_WORD1_CF_INST(x) (((unsigned)(x) & 0xF) << 26) 102 #define G_SQ_CF_ALU_WORD1_CF_INST(x) (((x) >> 26) & 0xF) 103 #define C_SQ_CF_ALU_WORD1_CF_INST 0xC3FFFFFF 104 #define S_SQ_CF_ALU_WORD1_WHOLE_QUAD_MODE(x) (((unsigned)(x) & 0x1) << 30) 105 #define G_SQ_CF_ALU_WORD1_WHOLE_QUAD_MODE(x) (((x) >> 30) & 0x1) 106 #define C_SQ_CF_ALU_WORD1_WHOLE_QUAD_MODE 0xBFFFFFFF 107 #define S_SQ_CF_ALU_WORD1_BARRIER(x) (((unsigned)(x) & 0x1) << 31) 108 #define G_SQ_CF_ALU_WORD1_BARRIER(x) (((x) >> 31) & 0x1) 109 #define C_SQ_CF_ALU_WORD1_BARRIER 0x7FFFFFFF 110 111 #define P_SQ_CF_ALU_WORD0_EXT 112 #define S_SQ_CF_ALU_WORD0_EXT_KCACHE_BANK_INDEX_MODE0(x) (((unsigned)(x) & 0x3) << 4) 113 #define G_SQ_CF_ALU_WORD0_EXT_KCACHE_BANK_INDEX_MODE0(x) (((x) >> 4) & 0x3) 114 #define C_SQ_CF_ALU_WORD0_EXT_KCACHE_BANK_INDEX_MODE0 0xFFFFFFCF 115 #define V_SQ_CF_INDEX_NONE 0x00 116 #define V_SQ_CF_INDEX_0 0x01 117 #define V_SQ_CF_INDEX_1 0x02 118 #define S_SQ_CF_ALU_WORD0_EXT_KCACHE_BANK_INDEX_MODE1(x) (((unsigned)(x) & 0x3) << 6) 119 #define G_SQ_CF_ALU_WORD0_EXT_KCACHE_BANK_INDEX_MODE1(x) (((x) >> 6) & 0x3) 120 #define C_SQ_CF_ALU_WORD0_EXT_KCACHE_BANK_INDEX_MODE1 0xFFFFFF3F 121 #define S_SQ_CF_ALU_WORD0_EXT_KCACHE_BANK_INDEX_MODE2(x) (((unsigned)(x) & 0x3) << 8) 122 #define G_SQ_CF_ALU_WORD0_EXT_KCACHE_BANK_INDEX_MODE2(x) (((x) >> 8) & 0x3) 123 #define C_SQ_CF_ALU_WORD0_EXT_KCACHE_BANK_INDEX_MODE2 0xFFFFFCFF 124 #define S_SQ_CF_ALU_WORD0_EXT_KCACHE_BANK_INDEX_MODE3(x) (((unsigned)(x) & 0x3) << 10) 125 #define G_SQ_CF_ALU_WORD0_EXT_KCACHE_BANK_INDEX_MODE3(x) (((x) >> 10) & 0x3) 126 #define C_SQ_CF_ALU_WORD0_EXT_KCACHE_BANK_INDEX_MODE3 0xFFFFF3FF 127 #define S_SQ_CF_ALU_WORD0_EXT_KCACHE_BANK2(x) (((unsigned)(x) & 0xF) << 22) 128 #define G_SQ_CF_ALU_WORD0_EXT_KCACHE_BANK2(x) (((x) >> 22) & 0xF) 129 #define C_SQ_CF_ALU_WORD0_EXT_KCACHE_BANK2 0xFC3FFFFF 130 #define S_SQ_CF_ALU_WORD0_EXT_KCACHE_BANK3(x) (((unsigned)(x) & 0xF) << 26) 131 #define G_SQ_CF_ALU_WORD0_EXT_KCACHE_BANK3(x) (((x) >> 26) & 0xF) 132 #define C_SQ_CF_ALU_WORD0_EXT_KCACHE_BANK3 0xC3FFFFFF 133 #define S_SQ_CF_ALU_WORD0_EXT_KCACHE_MODE2(x) (((unsigned)(x) & 0x3) << 30) 134 #define G_SQ_CF_ALU_WORD0_EXT_KCACHE_MODE2(x) (((x) >> 30) & 0x3) 135 #define C_SQ_CF_ALU_WORD0_EXT_KCACHE_MODE2 0x3FFFFFFF 136 137 #define P_SQ_CF_ALU_WORD1_EXT 138 #define S_SQ_CF_ALU_WORD1_EXT_KCACHE_MODE3(x) (((unsigned)(x) & 0x3) << 0) 139 #define G_SQ_CF_ALU_WORD1_EXT_KCACHE_MODE3(x) (((x) >> 0) & 0x3) 140 #define C_SQ_CF_ALU_WORD1_EXT_KCACHE_MODE3 0xFFFFFFFC 141 #define S_SQ_CF_ALU_WORD1_EXT_KCACHE_ADDR2(x) (((unsigned)(x) & 0xFF) << 2) 142 #define G_SQ_CF_ALU_WORD1_EXT_KCACHE_ADDR2(x) (((x) >> 2) & 0xFF) 143 #define C_SQ_CF_ALU_WORD1_EXT_KCACHE_ADDR2 0xFFFFFC03 144 #define S_SQ_CF_ALU_WORD1_EXT_KCACHE_ADDR3(x) (((unsigned)(x) & 0xFF) << 10) 145 #define G_SQ_CF_ALU_WORD1_EXT_KCACHE_ADDR3(x) (((x) >> 10) & 0xFF) 146 #define C_SQ_CF_ALU_WORD1_EXT_KCACHE_ADDR3 0xFFFC03FF 147 #define S_SQ_CF_ALU_WORD1_EXT_CF_INST(x) (((unsigned)(x) & 0xF) << 26) 148 #define G_SQ_CF_ALU_WORD1_EXT_CF_INST(x) (((x) >> 26) & 0xF) 149 #define C_SQ_CF_ALU_WORD1_EXT_CF_INST 0xC3FFFFFF 150 #define S_SQ_CF_ALU_WORD1_EXT_BARRIER(x) (((unsigned)(x) & 0x1) << 31) 151 #define G_SQ_CF_ALU_WORD1_EXT_BARRIER(x) (((x) >> 31) & 0x1) 152 #define C_SQ_CF_ALU_WORD1_EXT_BARRIER 0x7FFFFFFF 153 154 /* done */ 155 #define P_SQ_CF_ALLOC_EXPORT_WORD0 156 #define S_SQ_CF_ALLOC_EXPORT_WORD0_ARRAY_BASE(x) (((unsigned)(x) & 0x1FFF) << 0) 157 #define G_SQ_CF_ALLOC_EXPORT_WORD0_ARRAY_BASE(x) (((x) >> 0) & 0x1FFF) 158 #define C_SQ_CF_ALLOC_EXPORT_WORD0_ARRAY_BASE 0xFFFFE000 159 #define S_SQ_CF_ALLOC_EXPORT_WORD0_TYPE(x) (((unsigned)(x) & 0x3) << 13) 160 #define G_SQ_CF_ALLOC_EXPORT_WORD0_TYPE(x) (((x) >> 13) & 0x3) 161 #define C_SQ_CF_ALLOC_EXPORT_WORD0_TYPE 0xFFFF9FFF 162 #define V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PIXEL 0x00000000 163 #define V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_POS 0x00000001 164 #define V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PARAM 0x00000002 165 #define V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_WRITE 0x00000000 166 #define V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_WRITE_IND 0x00000001 167 #define V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_READ 0x00000002 168 #define V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_READ_IND 0x00000003 169 170 #define S_SQ_CF_ALLOC_EXPORT_WORD0_RW_GPR(x) (((unsigned)(x) & 0x7F) << 15) 171 #define G_SQ_CF_ALLOC_EXPORT_WORD0_RW_GPR(x) (((x) >> 15) & 0x7F) 172 #define C_SQ_CF_ALLOC_EXPORT_WORD0_RW_GPR 0xFFC07FFF 173 #define S_SQ_CF_ALLOC_EXPORT_WORD0_RW_REL(x) (((unsigned)(x) & 0x1) << 22) 174 #define G_SQ_CF_ALLOC_EXPORT_WORD0_RW_REL(x) (((x) >> 22) & 0x1) 175 #define C_SQ_CF_ALLOC_EXPORT_WORD0_RW_REL 0xFFBFFFFF 176 #define S_SQ_CF_ALLOC_EXPORT_WORD0_INDEX_GPR(x) (((unsigned)(x) & 0x7F) << 23) 177 #define G_SQ_CF_ALLOC_EXPORT_WORD0_INDEX_GPR(x) (((x) >> 23) & 0x7F) 178 #define C_SQ_CF_ALLOC_EXPORT_WORD0_INDEX_GPR 0xC07FFFFF 179 #define S_SQ_CF_ALLOC_EXPORT_WORD0_ELEM_SIZE(x) (((unsigned)(x) & 0x3) << 30) 180 #define G_SQ_CF_ALLOC_EXPORT_WORD0_ELEM_SIZE(x) (((x) >> 30) & 0x3) 181 #define C_SQ_CF_ALLOC_EXPORT_WORD0_ELEM_SIZE 0x3FFFFFFF 182 /* done */ 183 184 #define P_SQ_CF_ALLOC_EXPORT_WORD0_RAT 185 #define S_SQ_CF_ALLOC_EXPORT_WORD0_RAT_RAT_ID(x) (((x) & 0xF) << 0) 186 #define G_SQ_CF_ALLOC_EXPORT_WORD0_RAT_RAT_ID(x) (((x) >> 0) & 0xF) 187 #define C_SQ_CF_ALLOC_EXPORT_WORD0_RAT_RAT_ID 0xFFFFFFF0 188 #define S_SQ_CF_ALLOC_EXPORT_WORD0_RAT_RAT_INST(x) (((x) & 0x3F) << 4) 189 #define G_SQ_CF_ALLOC_EXPORT_WORD0_RAT_RAT_INST(x) (((x) >> 4) & 0x3F) 190 #define C_SQ_CF_ALLOC_EXPORT_WORD0_RAT_RAT_INST 0xFFFFFC0F 191 #define S_SQ_CF_ALLOC_EXPORT_WORD0_RAT_RAT_INDEX_MODE(x) (((x) & 0x3) << 11) 192 #define G_SQ_CF_ALLOC_EXPORT_WORD0_RAT_RAT_INDEX_MODE(x) (((x) >> 11) & 0x3) 193 #define C_SQ_CF_ALLOC_EXPORT_WORD0_RAT_RAT_INDEX_MODE 0xFFFFE7FF 194 195 #define P_SQ_CF_ALLOC_EXPORT_WORD1 196 #define S_SQ_CF_ALLOC_EXPORT_WORD1_BURST_COUNT(x) (((unsigned)(x) & 0xF) << 16) 197 #define G_SQ_CF_ALLOC_EXPORT_WORD1_BURST_COUNT(x) (((x) >> 16) & 0xF) 198 #define C_SQ_CF_ALLOC_EXPORT_WORD1_BURST_COUNT 0xFFF0FFFF 199 #define S_SQ_CF_ALLOC_EXPORT_WORD1_VALID_PIXEL_MODE(x) (((unsigned)(x) & 0x1) << 20) 200 #define G_SQ_CF_ALLOC_EXPORT_WORD1_VALID_PIXEL_MODE(x) (((x) >> 20) & 0x1) 201 #define C_SQ_CF_ALLOC_EXPORT_WORD1_VALID_PIXEL_MODE 0xFFEFFFFF 202 #define S_SQ_CF_ALLOC_EXPORT_WORD1_END_OF_PROGRAM(x) (((unsigned)(x) & 0x1) << 21) 203 #define G_SQ_CF_ALLOC_EXPORT_WORD1_END_OF_PROGRAM(x) (((x) >> 21) & 0x1) 204 #define C_SQ_CF_ALLOC_EXPORT_WORD1_END_OF_PROGRAM 0xFFDFFFFF 205 #define S_SQ_CF_ALLOC_EXPORT_WORD1_CF_INST(x) (((unsigned)(x) & 0xFF) << 22) 206 #define G_SQ_CF_ALLOC_EXPORT_WORD1_CF_INST(x) (((x) >> 22) & 0xFF) 207 #define C_SQ_CF_ALLOC_EXPORT_WORD1_CF_INST 0xC03FFFFF 208 209 #define S_SQ_CF_ALLOC_EXPORT_WORD1_MARK(x) (((unsigned)(x) & 0x1) << 30) 210 #define G_SQ_CF_ALLOC_EXPORT_WORD1_MARK(x) (((x) >> 30) & 0x1) 211 #define C_SQ_CF_ALLOC_EXPORT_WORD1_WHOLE_QUAD_MODE 0xBFFFFFFF 212 #define S_SQ_CF_ALLOC_EXPORT_WORD1_BARRIER(x) (((unsigned)(x) & 0x1) << 31) 213 #define G_SQ_CF_ALLOC_EXPORT_WORD1_BARRIER(x) (((x) >> 31) & 0x1) 214 #define C_SQ_CF_ALLOC_EXPORT_WORD1_BARRIER 0x7FFFFFFF 215 216 /* done */ 217 #define P_SQ_CF_ALLOC_EXPORT_WORD1_BUF 218 #define S_SQ_CF_ALLOC_EXPORT_WORD1_BUF_ARRAY_SIZE(x) (((unsigned)(x) & 0xFFF) << 0) 219 #define G_SQ_CF_ALLOC_EXPORT_WORD1_BUF_ARRAY_SIZE(x) (((x) >> 0) & 0xFFF) 220 #define C_SQ_CF_ALLOC_EXPORT_WORD1_BUF_ARRAY_SIZE 0xFFFFF000 221 #define S_SQ_CF_ALLOC_EXPORT_WORD1_BUF_COMP_MASK(x) (((unsigned)(x) & 0xF) << 12) 222 #define G_SQ_CF_ALLOC_EXPORT_WORD1_BUF_COMP_MASK(x) (((x) >> 12) & 0xF) 223 #define C_SQ_CF_ALLOC_EXPORT_WORD1_BUF_COMP_MASK 0xFFFF0FFF 224 #define P_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ 225 #define S_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_X(x) (((unsigned)(x) & 0x7) << 0) 226 #define G_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_X(x) (((x) >> 0) & 0x7) 227 #define C_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_X 0xFFFFFFF8 228 #define S_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_Y(x) (((unsigned)(x) & 0x7) << 3) 229 #define G_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_Y(x) (((x) >> 3) & 0x7) 230 #define C_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_Y 0xFFFFFFC7 231 #define S_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_Z(x) (((unsigned)(x) & 0x7) << 6) 232 #define G_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_Z(x) (((x) >> 6) & 0x7) 233 #define C_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_Z 0xFFFFFE3F 234 #define S_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_W(x) (((unsigned)(x) & 0x7) << 9) 235 #define G_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_W(x) (((x) >> 9) & 0x7) 236 #define C_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_W 0xFFFFF1FF 237 238 /* done */ 239 #define P_SQ_ALU_WORD0 240 #define S_SQ_ALU_WORD0_SRC0_SEL(x) (((unsigned)(x) & 0x1FF) << 0) 241 #define G_SQ_ALU_WORD0_SRC0_SEL(x) (((x) >> 0) & 0x1FF) 242 #define C_SQ_ALU_WORD0_SRC0_SEL 0xFFFFFE00 243 244 /* 245 * 244 ALU_SRC_1_DBL_L: special constant 1.0 double-float, LSW. (RV670+) 246 * 245 ALU_SRC_1_DBL_M: special constant 1.0 double-float, MSW. (RV670+) 247 * 246 ALU_SRC_0_5_DBL_L: special constant 0.5 double-float, LSW. (RV670+) 248 * 247 ALU_SRC_0_5_DBL_M: special constant 0.5 double-float, MSW. (RV670+) 249 * 248 SQ_ALU_SRC_0: special constant 0.0. 250 * 249 SQ_ALU_SRC_1: special constant 1.0 float. 251 * 250 SQ_ALU_SRC_1_INT: special constant 1 integer. 252 * 251 SQ_ALU_SRC_M_1_INT: special constant -1 integer. 253 * 252 SQ_ALU_SRC_0_5: special constant 0.5 float. 254 * 253 SQ_ALU_SRC_LITERAL: literal constant. 255 * 254 SQ_ALU_SRC_PV: previous vector result. 256 * 255 SQ_ALU_SRC_PS: previous scalar result. 257 */ 258 #define V_SQ_ALU_SRC_0 0x000000F8 259 #define V_SQ_ALU_SRC_1 0x000000F9 260 #define V_SQ_ALU_SRC_1_INT 0x000000FA 261 #define V_SQ_ALU_SRC_M_1_INT 0x000000FB 262 #define V_SQ_ALU_SRC_0_5 0x000000FC 263 #define V_SQ_ALU_SRC_LITERAL 0x000000FD 264 #define S_SQ_ALU_WORD0_SRC0_REL(x) (((unsigned)(x) & 0x1) << 9) 265 #define G_SQ_ALU_WORD0_SRC0_REL(x) (((x) >> 9) & 0x1) 266 #define C_SQ_ALU_WORD0_SRC0_REL 0xFFFFFDFF 267 #define S_SQ_ALU_WORD0_SRC0_CHAN(x) (((unsigned)(x) & 0x3) << 10) 268 #define G_SQ_ALU_WORD0_SRC0_CHAN(x) (((x) >> 10) & 0x3) 269 #define C_SQ_ALU_WORD0_SRC0_CHAN 0xFFFFF3FF 270 #define S_SQ_ALU_WORD0_SRC0_NEG(x) (((unsigned)(x) & 0x1) << 12) 271 #define G_SQ_ALU_WORD0_SRC0_NEG(x) (((x) >> 12) & 0x1) 272 #define C_SQ_ALU_WORD0_SRC0_NEG 0xFFFFEFFF 273 #define S_SQ_ALU_WORD0_SRC1_SEL(x) (((unsigned)(x) & 0x1FF) << 13) 274 #define G_SQ_ALU_WORD0_SRC1_SEL(x) (((x) >> 13) & 0x1FF) 275 #define C_SQ_ALU_WORD0_SRC1_SEL 0xFFC01FFF 276 #define S_SQ_ALU_WORD0_SRC1_REL(x) (((unsigned)(x) & 0x1) << 22) 277 #define G_SQ_ALU_WORD0_SRC1_REL(x) (((x) >> 22) & 0x1) 278 #define C_SQ_ALU_WORD0_SRC1_REL 0xFFBFFFFF 279 #define S_SQ_ALU_WORD0_SRC1_CHAN(x) (((unsigned)(x) & 0x3) << 23) 280 #define G_SQ_ALU_WORD0_SRC1_CHAN(x) (((x) >> 23) & 0x3) 281 #define C_SQ_ALU_WORD0_SRC1_CHAN 0xFE7FFFFF 282 #define S_SQ_ALU_WORD0_SRC1_NEG(x) (((unsigned)(x) & 0x1) << 25) 283 #define G_SQ_ALU_WORD0_SRC1_NEG(x) (((x) >> 25) & 0x1) 284 #define C_SQ_ALU_WORD0_SRC1_NEG 0xFDFFFFFF 285 #define S_SQ_ALU_WORD0_INDEX_MODE(x) (((unsigned)(x) & 0x7) << 26) 286 #define G_SQ_ALU_WORD0_INDEX_MODE(x) (((x) >> 26) & 0x7) 287 #define C_SQ_ALU_WORD0_INDEX_MODE 0xE3FFFFFF 288 #define S_SQ_ALU_WORD0_PRED_SEL(x) (((unsigned)(x) & 0x3) << 29) 289 #define G_SQ_ALU_WORD0_PRED_SEL(x) (((x) >> 29) & 0x3) 290 #define C_SQ_ALU_WORD0_PRED_SEL 0x9FFFFFFF 291 #define S_SQ_ALU_WORD0_LAST(x) (((unsigned)(x) & 0x1) << 31) 292 #define G_SQ_ALU_WORD0_LAST(x) (((x) >> 31) & 0x1) 293 #define C_SQ_ALU_WORD0_LAST 0x7FFFFFFF 294 /* same */ 295 #define P_SQ_ALU_WORD1 296 #define S_SQ_ALU_WORD1_ENCODING(x) (((unsigned)(x) & 0x7) << 15) 297 #define G_SQ_ALU_WORD1_ENCODING(x) (((x) >> 15) & 0x7) 298 #define C_SQ_ALU_WORD1_ENCODING 0xFFFC7FFF 299 #define S_SQ_ALU_WORD1_BANK_SWIZZLE(x) (((unsigned)(x) & 0x7) << 18) 300 #define G_SQ_ALU_WORD1_BANK_SWIZZLE(x) (((x) >> 18) & 0x7) 301 #define C_SQ_ALU_WORD1_BANK_SWIZZLE 0xFFE3FFFF 302 #define S_SQ_ALU_WORD1_DST_GPR(x) (((unsigned)(x) & 0x7F) << 21) 303 #define G_SQ_ALU_WORD1_DST_GPR(x) (((x) >> 21) & 0x7F) 304 #define C_SQ_ALU_WORD1_DST_GPR 0xF01FFFFF 305 #define S_SQ_ALU_WORD1_DST_REL(x) (((unsigned)(x) & 0x1) << 28) 306 #define G_SQ_ALU_WORD1_DST_REL(x) (((x) >> 28) & 0x1) 307 #define C_SQ_ALU_WORD1_DST_REL 0xEFFFFFFF 308 #define S_SQ_ALU_WORD1_DST_CHAN(x) (((unsigned)(x) & 0x3) << 29) 309 #define G_SQ_ALU_WORD1_DST_CHAN(x) (((x) >> 29) & 0x3) 310 #define C_SQ_ALU_WORD1_DST_CHAN 0x9FFFFFFF 311 #define S_SQ_ALU_WORD1_CLAMP(x) (((unsigned)(x) & 0x1) << 31) 312 #define G_SQ_ALU_WORD1_CLAMP(x) (((x) >> 31) & 0x1) 313 #define C_SQ_ALU_WORD1_CLAMP 0x7FFFFFFF 314 /* same except maybe encoding */ 315 #define P_SQ_ALU_WORD1_OP2 316 #define S_SQ_ALU_WORD1_OP2_SRC0_ABS(x) (((unsigned)(x) & 0x1) << 0) 317 #define G_SQ_ALU_WORD1_OP2_SRC0_ABS(x) (((x) >> 0) & 0x1) 318 #define C_SQ_ALU_WORD1_OP2_SRC0_ABS 0xFFFFFFFE 319 #define S_SQ_ALU_WORD1_OP2_SRC1_ABS(x) (((unsigned)(x) & 0x1) << 1) 320 #define G_SQ_ALU_WORD1_OP2_SRC1_ABS(x) (((x) >> 1) & 0x1) 321 #define C_SQ_ALU_WORD1_OP2_SRC1_ABS 0xFFFFFFFD 322 #define S_SQ_ALU_WORD1_OP2_UPDATE_EXECUTE_MASK(x) (((unsigned)(x) & 0x1) << 2) 323 #define G_SQ_ALU_WORD1_OP2_UPDATE_EXECUTE_MASK(x) (((x) >> 2) & 0x1) 324 #define C_SQ_ALU_WORD1_OP2_UPDATE_EXECUTE_MASK 0xFFFFFFFB 325 #define S_SQ_ALU_WORD1_OP2_UPDATE_PRED(x) (((unsigned)(x) & 0x1) << 3) 326 #define G_SQ_ALU_WORD1_OP2_UPDATE_PRED(x) (((x) >> 3) & 0x1) 327 #define C_SQ_ALU_WORD1_OP2_UPDATE_PRED 0xFFFFFFF7 328 #define S_SQ_ALU_WORD1_OP2_WRITE_MASK(x) (((unsigned)(x) & 0x1) << 4) 329 #define G_SQ_ALU_WORD1_OP2_WRITE_MASK(x) (((x) >> 4) & 0x1) 330 #define C_SQ_ALU_WORD1_OP2_WRITE_MASK 0xFFFFFFEF 331 #define S_SQ_ALU_WORD1_OP2_OMOD(x) (((unsigned)(x) & 0x3) << 5) 332 #define G_SQ_ALU_WORD1_OP2_OMOD(x) (((x) >> 5) & 0x3) 333 #define C_SQ_ALU_WORD1_OP2_OMOD 0xFFFFFF9F 334 #define S_SQ_ALU_WORD1_OP2_ALU_INST(x) (((unsigned)(x) & 0x7FF) << 7) 335 #define G_SQ_ALU_WORD1_OP2_ALU_INST(x) (((x) >> 7) & 0x7FF) 336 #define C_SQ_ALU_WORD1_OP2_ALU_INST 0xFFFC007F 337 338 #define P_SQ_ALU_WORD1_OP3 339 #define S_SQ_ALU_WORD1_OP3_SRC2_SEL(x) (((unsigned)(x) & 0x1FF) << 0) 340 #define G_SQ_ALU_WORD1_OP3_SRC2_SEL(x) (((x) >> 0) & 0x1FF) 341 #define C_SQ_ALU_WORD1_OP3_SRC2_SEL 0xFFFFFE00 342 #define S_SQ_ALU_WORD1_OP3_SRC2_REL(x) (((unsigned)(x) & 0x1) << 9) 343 #define G_SQ_ALU_WORD1_OP3_SRC2_REL(x) (((x) >> 9) & 0x1) 344 #define C_SQ_ALU_WORD1_OP3_SRC2_REL 0xFFFFFDFF 345 #define S_SQ_ALU_WORD1_OP3_SRC2_CHAN(x) (((unsigned)(x) & 0x3) << 10) 346 #define G_SQ_ALU_WORD1_OP3_SRC2_CHAN(x) (((x) >> 10) & 0x3) 347 #define C_SQ_ALU_WORD1_OP3_SRC2_CHAN 0xFFFFF3FF 348 #define S_SQ_ALU_WORD1_OP3_SRC2_NEG(x) (((unsigned)(x) & 0x1) << 12) 349 #define G_SQ_ALU_WORD1_OP3_SRC2_NEG(x) (((x) >> 12) & 0x1) 350 #define C_SQ_ALU_WORD1_OP3_SRC2_NEG 0xFFFFEFFF 351 #define S_SQ_ALU_WORD1_OP3_ALU_INST(x) (((unsigned)(x) & 0x1F) << 13) 352 #define G_SQ_ALU_WORD1_OP3_ALU_INST(x) (((x) >> 13) & 0x1F) 353 #define C_SQ_ALU_WORD1_OP3_ALU_INST 0xFFFC1FFF 354 /* XXX ADD OTHER OP3 */ 355 /* done */ 356 #define P_SQ_VTX_WORD0 357 #define S_SQ_VTX_WORD0_VTX_INST(x) (((unsigned)(x) & 0x1F) << 0) 358 #define G_SQ_VTX_WORD0_VTX_INST(x) (((x) >> 0) & 0x1F) 359 #define C_SQ_VTX_WORD0_VTX_INST 0xFFFFFFE0 360 #define S_SQ_VTX_WORD0_FETCH_TYPE(x) (((unsigned)(x) & 0x3) << 5) 361 #define G_SQ_VTX_WORD0_FETCH_TYPE(x) (((x) >> 5) & 0x3) 362 #define C_SQ_VTX_WORD0_FETCH_TYPE 0xFFFFFF9F 363 #define S_SQ_VTX_WORD0_FETCH_WHOLE_QUAD(x) (((unsigned)(x) & 0x1) << 7) 364 #define G_SQ_VTX_WORD0_FETCH_WHOLE_QUAD(x) (((x) >> 7) & 0x1) 365 #define C_SQ_VTX_WORD0_FETCH_WHOLE_QUAD 0xFFFFFF7F 366 #define S_SQ_VTX_WORD0_BUFFER_ID(x) (((unsigned)(x) & 0xFF) << 8) 367 #define G_SQ_VTX_WORD0_BUFFER_ID(x) (((x) >> 8) & 0xFF) 368 #define C_SQ_VTX_WORD0_BUFFER_ID 0xFFFF00FF 369 #define S_SQ_VTX_WORD0_SRC_GPR(x) (((unsigned)(x) & 0x7F) << 16) 370 #define G_SQ_VTX_WORD0_SRC_GPR(x) (((x) >> 16) & 0x7F) 371 #define C_SQ_VTX_WORD0_SRC_GPR 0xFF80FFFF 372 #define S_SQ_VTX_WORD0_SRC_REL(x) (((unsigned)(x) & 0x1) << 23) 373 #define G_SQ_VTX_WORD0_SRC_REL(x) (((x) >> 23) & 0x1) 374 #define C_SQ_VTX_WORD0_SRC_REL 0xFF7FFFFF 375 #define S_SQ_VTX_WORD0_SRC_SEL_X(x) (((unsigned)(x) & 0x3) << 24) 376 #define G_SQ_VTX_WORD0_SRC_SEL_X(x) (((x) >> 24) & 0x3) 377 #define C_SQ_VTX_WORD0_SRC_SEL_X 0xFCFFFFFF 378 #define S_SQ_VTX_WORD0_MEGA_FETCH_COUNT(x) (((unsigned)(x) & 0x3F) << 26) 379 #define G_SQ_VTX_WORD0_MEGA_FETCH_COUNT(x) (((x) >> 26) & 0x3F) 380 #define C_SQ_VTX_WORD0_MEGA_FETCH_COUNT 0x03FFFFFF 381 /* same WORD 0 */ 382 #define P_SQ_VTX_WORD1 383 #define S_SQ_VTX_WORD1_DST_SEL_X(x) (((unsigned)(x) & 0x7) << 9) 384 #define G_SQ_VTX_WORD1_DST_SEL_X(x) (((x) >> 9) & 0x7) 385 #define C_SQ_VTX_WORD1_DST_SEL_X 0xFFFFF1FF 386 #define S_SQ_VTX_WORD1_DST_SEL_Y(x) (((unsigned)(x) & 0x7) << 12) 387 #define G_SQ_VTX_WORD1_DST_SEL_Y(x) (((x) >> 12) & 0x7) 388 #define C_SQ_VTX_WORD1_DST_SEL_Y 0xFFFF8FFF 389 #define S_SQ_VTX_WORD1_DST_SEL_Z(x) (((unsigned)(x) & 0x7) << 15) 390 #define G_SQ_VTX_WORD1_DST_SEL_Z(x) (((x) >> 15) & 0x7) 391 #define C_SQ_VTX_WORD1_DST_SEL_Z 0xFFFC7FFF 392 #define S_SQ_VTX_WORD1_DST_SEL_W(x) (((unsigned)(x) & 0x7) << 18) 393 #define G_SQ_VTX_WORD1_DST_SEL_W(x) (((x) >> 18) & 0x7) 394 #define C_SQ_VTX_WORD1_DST_SEL_W 0xFFE3FFFF 395 #define S_SQ_VTX_WORD1_USE_CONST_FIELDS(x) (((unsigned)(x) & 0x1) << 21) 396 #define G_SQ_VTX_WORD1_USE_CONST_FIELDS(x) (((x) >> 21) & 0x1) 397 #define C_SQ_VTX_WORD1_USE_CONST_FIELDS 0xFFDFFFFF 398 #define S_SQ_VTX_WORD1_DATA_FORMAT(x) (((unsigned)(x) & 0x3F) << 22) 399 #define G_SQ_VTX_WORD1_DATA_FORMAT(x) (((x) >> 22) & 0x3F) 400 #define C_SQ_VTX_WORD1_DATA_FORMAT 0xF03FFFFF 401 #define S_SQ_VTX_WORD1_NUM_FORMAT_ALL(x) (((unsigned)(x) & 0x3) << 28) 402 #define G_SQ_VTX_WORD1_NUM_FORMAT_ALL(x) (((x) >> 28) & 0x3) 403 #define C_SQ_VTX_WORD1_NUM_FORMAT_ALL 0xCFFFFFFF 404 #define S_SQ_VTX_WORD1_FORMAT_COMP_ALL(x) (((unsigned)(x) & 0x1) << 30) 405 #define G_SQ_VTX_WORD1_FORMAT_COMP_ALL(x) (((x) >> 30) & 0x1) 406 #define C_SQ_VTX_WORD1_FORMAT_COMP_ALL 0xBFFFFFFF 407 #define S_SQ_VTX_WORD1_SRF_MODE_ALL(x) (((unsigned)(x) & 0x1) << 31) 408 #define G_SQ_VTX_WORD1_SRF_MODE_ALL(x) (((x) >> 31) & 0x1) 409 #define C_SQ_VTX_WORD1_SRF_MODE_ALL 0x7FFFFFFF 410 /* same WORD1 generic */ 411 #define P_SQ_VTX_WORD1_GPR 412 #define S_SQ_VTX_WORD1_GPR_DST_GPR(x) (((unsigned)(x) & 0x7F) << 0) 413 #define G_SQ_VTX_WORD1_GPR_DST_GPR(x) (((x) >> 0) & 0x7F) 414 #define C_SQ_VTX_WORD1_GPR_DST_GPR 0xFFFFFF80 415 #define S_SQ_VTX_WORD1_GPR_DST_REL(x) (((unsigned)(x) & 0x1) << 7) 416 #define G_SQ_VTX_WORD1_GPR_DST_REL(x) (((x) >> 7) & 0x1) 417 #define C_SQ_VTX_WORD1_GPR_DST_REL 0xFFFFFF7F 418 #define P_SQ_VTX_WORD1_SEM 419 #define S_SQ_VTX_WORD1_SEM_SEMANTIC_ID(x) (((unsigned)(x) & 0xFF) << 0) 420 #define G_SQ_VTX_WORD1_SEM_SEMANTIC_ID(x) (((x) >> 0) & 0xFF) 421 #define C_SQ_VTX_WORD1_SEM_SEMANTIC_ID 0xFFFFFF00 422 #define P_SQ_VTX_WORD2 423 #define S_SQ_VTX_WORD2_OFFSET(x) (((unsigned)(x) & 0xFFFF) << 0) 424 #define G_SQ_VTX_WORD2_OFFSET(x) (((x) >> 0) & 0xFFFF) 425 #define C_SQ_VTX_WORD2_OFFSET 0xFFFF0000 426 #define S_SQ_VTX_WORD2_ENDIAN_SWAP(x) (((unsigned)(x) & 0x3) << 16) 427 #define G_SQ_VTX_WORD2_ENDIAN_SWAP(x) (((x) >> 16) & 0x3) 428 #define C_SQ_VTX_WORD2_ENDIAN_SWAP 0xFFFCFFFF 429 #define S_SQ_VTX_WORD2_CONST_BUF_NO_STRIDE(x) (((unsigned)(x) & 0x1) << 18) 430 #define G_SQ_VTX_WORD2_CONST_BUF_NO_STRIDE(x) (((x) >> 18) & 0x1) 431 #define C_SQ_VTX_WORD2_CONST_BUF_NO_STRIDE 0xFFFBFFFF 432 #define S_SQ_VTX_WORD2_MEGA_FETCH(x) (((unsigned)(x) & 0x1) << 19) 433 #define G_SQ_VTX_WORD2_MEGA_FETCH(x) (((x) >> 19) & 0x1) 434 #define C_SQ_VTX_WORD2_MEGA_FETCH 0xFFF7FFFF 435 #define S_SQ_VTX_WORD2_ALT_CONST(x) (((unsigned)(x) & 0x1) << 20) 436 #define G_SQ_VTX_WORD2_ALT_CONST(x) (((x) >> 20) & 0x1) 437 #define C_SQ_VTX_WORD2_ALT_CONST 0xFFEFFFFF 438 #define S_SQ_VTX_WORD2_BIM(x) (((unsigned)(x) & 0x3) << 21) 439 #define G_SQ_VTX_WORD2_BIM(x) (((x) >> 21) & 0x3) 440 #define C_SQ_VTX_WORD2_BIM 0xFF9FFFFF 441 /* done */ 442 443 #define P_SQ_TEX_WORD0 444 #define S_SQ_TEX_WORD0_TEX_INST(x) (((unsigned)(x) & 0x1F) << 0) 445 #define G_SQ_TEX_WORD0_TEX_INST(x) (((x) >> 0) & 0x1F) 446 #define C_SQ_TEX_WORD0_TEX_INST 0xFFFFFFE0 447 #define S_SQ_TEX_WORD0_INST_MOD(x) (((unsigned)(x) & 0x3) << 5) 448 #define G_SQ_TEX_WORD0_INST_MOD(x) (((x) >> 5) & 0x3) 449 #define C_SQ_TEX_WORD0_INST_MOD 0xFFFFFF9F 450 #define S_SQ_TEX_WORD0_FETCH_WHOLE_QUAD(x) (((unsigned)(x) & 0x1) << 7) 451 #define G_SQ_TEX_WORD0_FETCH_WHOLE_QUAD(x) (((x) >> 7) & 0x1) 452 #define C_SQ_TEX_WORD0_FETCH_WHOLE_QUAD 0xFFFFFF7F 453 #define S_SQ_TEX_WORD0_RESOURCE_ID(x) (((unsigned)(x) & 0xFF) << 8) 454 #define G_SQ_TEX_WORD0_RESOURCE_ID(x) (((x) >> 8) & 0xFF) 455 #define C_SQ_TEX_WORD0_RESOURCE_ID 0xFFFF00FF 456 #define S_SQ_TEX_WORD0_SRC_GPR(x) (((unsigned)(x) & 0x7F) << 16) 457 #define G_SQ_TEX_WORD0_SRC_GPR(x) (((x) >> 16) & 0x7F) 458 #define C_SQ_TEX_WORD0_SRC_GPR 0xFF80FFFF 459 #define S_SQ_TEX_WORD0_SRC_REL(x) (((unsigned)(x) & 0x1) << 23) 460 #define G_SQ_TEX_WORD0_SRC_REL(x) (((x) >> 23) & 0x1) 461 #define C_SQ_TEX_WORD0_SRC_REL 0xFF7FFFFF 462 #define S_SQ_TEX_WORD0_ALT_CONST(x) (((unsigned)(x) & 0x1) << 24) 463 #define G_SQ_TEX_WORD0_ALT_CONST(x) (((x) >> 24) & 0x1) 464 #define C_SQ_TEX_WORD0_ALT_CONST 0xFEFFFFFF 465 #define S_SQ_TEX_WORD0_RIM(x) (((unsigned)(x) & 0x3) << 25) 466 #define G_SQ_TEX_WORD0_RIM(x) (((x) >> 25) & 0x3) 467 #define C_SQ_TEX_WORD0_RIM 0xF9FFFFFF 468 #define S_SQ_TEX_WORD0_SIM(x) (((unsigned)(x) & 0x3) << 27) 469 #define G_SQ_TEX_WORD0_SIM(x) (((x) >> 27) & 0x3) 470 #define C_SQ_TEX_WORD0_SIM 0xE7FFFFFF 471 #define P_SQ_TEX_WORD1 472 #define S_SQ_TEX_WORD1_DST_GPR(x) (((unsigned)(x) & 0x7F) << 0) 473 #define G_SQ_TEX_WORD1_DST_GPR(x) (((x) >> 0) & 0x7F) 474 #define C_SQ_TEX_WORD1_DST_GPR 0xFFFFFF80 475 #define S_SQ_TEX_WORD1_DST_REL(x) (((unsigned)(x) & 0x1) << 7) 476 #define G_SQ_TEX_WORD1_DST_REL(x) (((x) >> 7) & 0x1) 477 #define C_SQ_TEX_WORD1_DST_REL 0xFFFFFF7F 478 #define S_SQ_TEX_WORD1_DST_SEL_X(x) (((unsigned)(x) & 0x7) << 9) 479 #define G_SQ_TEX_WORD1_DST_SEL_X(x) (((x) >> 9) & 0x7) 480 #define C_SQ_TEX_WORD1_DST_SEL_X 0xFFFFF1FF 481 #define S_SQ_TEX_WORD1_DST_SEL_Y(x) (((unsigned)(x) & 0x7) << 12) 482 #define G_SQ_TEX_WORD1_DST_SEL_Y(x) (((x) >> 12) & 0x7) 483 #define C_SQ_TEX_WORD1_DST_SEL_Y 0xFFFF8FFF 484 #define S_SQ_TEX_WORD1_DST_SEL_Z(x) (((unsigned)(x) & 0x7) << 15) 485 #define G_SQ_TEX_WORD1_DST_SEL_Z(x) (((x) >> 15) & 0x7) 486 #define C_SQ_TEX_WORD1_DST_SEL_Z 0xFFFC7FFF 487 #define S_SQ_TEX_WORD1_DST_SEL_W(x) (((unsigned)(x) & 0x7) << 18) 488 #define G_SQ_TEX_WORD1_DST_SEL_W(x) (((x) >> 18) & 0x7) 489 #define C_SQ_TEX_WORD1_DST_SEL_W 0xFFE3FFFF 490 #define S_SQ_TEX_WORD1_LOD_BIAS(x) (((unsigned)(x) & 0x7F) << 21) 491 #define G_SQ_TEX_WORD1_LOD_BIAS(x) (((x) >> 21) & 0x7F) 492 #define C_SQ_TEX_WORD1_LOD_BIAS 0xF01FFFFF 493 #define S_SQ_TEX_WORD1_COORD_TYPE_X(x) (((unsigned)(x) & 0x1) << 28) 494 #define G_SQ_TEX_WORD1_COORD_TYPE_X(x) (((x) >> 28) & 0x1) 495 #define C_SQ_TEX_WORD1_COORD_TYPE_X 0xEFFFFFFF 496 #define V_SQ_TEX_WORD1_COORD_UNNORMALIZED 0x00000000 497 #define V_SQ_TEX_WORD1_COORD_NORMALIZED 0x00000001 498 #define S_SQ_TEX_WORD1_COORD_TYPE_Y(x) (((unsigned)(x) & 0x1) << 29) 499 #define G_SQ_TEX_WORD1_COORD_TYPE_Y(x) (((x) >> 29) & 0x1) 500 #define C_SQ_TEX_WORD1_COORD_TYPE_Y 0xDFFFFFFF 501 #define S_SQ_TEX_WORD1_COORD_TYPE_Z(x) (((unsigned)(x) & 0x1) << 30) 502 #define G_SQ_TEX_WORD1_COORD_TYPE_Z(x) (((x) >> 30) & 0x1) 503 #define C_SQ_TEX_WORD1_COORD_TYPE_Z 0xBFFFFFFF 504 #define S_SQ_TEX_WORD1_COORD_TYPE_W(x) (((unsigned)(x) & 0x1) << 31) 505 #define G_SQ_TEX_WORD1_COORD_TYPE_W(x) (((x) >> 31) & 0x1) 506 #define C_SQ_TEX_WORD1_COORD_TYPE_W 0x7FFFFFFF 507 #define P_SQ_TEX_WORD2 508 #define S_SQ_TEX_WORD2_OFFSET_X(x) (((unsigned)(x) & 0x1F) << 0) 509 #define G_SQ_TEX_WORD2_OFFSET_X(x) (((x) >> 0) & 0x1F) 510 #define C_SQ_TEX_WORD2_OFFSET_X 0xFFFFFFE0 511 #define S_SQ_TEX_WORD2_OFFSET_Y(x) (((unsigned)(x) & 0x1F) << 5) 512 #define G_SQ_TEX_WORD2_OFFSET_Y(x) (((x) >> 5) & 0x1F) 513 #define C_SQ_TEX_WORD2_OFFSET_Y 0xFFFFFC1F 514 #define S_SQ_TEX_WORD2_OFFSET_Z(x) (((unsigned)(x) & 0x1F) << 10) 515 #define G_SQ_TEX_WORD2_OFFSET_Z(x) (((x) >> 10) & 0x1F) 516 #define C_SQ_TEX_WORD2_OFFSET_Z 0xFFFF83FF 517 #define S_SQ_TEX_WORD2_SAMPLER_ID(x) (((unsigned)(x) & 0x1F) << 15) 518 #define G_SQ_TEX_WORD2_SAMPLER_ID(x) (((x) >> 15) & 0x1F) 519 #define C_SQ_TEX_WORD2_SAMPLER_ID 0xFFF07FFF 520 #define S_SQ_TEX_WORD2_SRC_SEL_X(x) (((unsigned)(x) & 0x7) << 20) 521 #define G_SQ_TEX_WORD2_SRC_SEL_X(x) (((x) >> 20) & 0x7) 522 #define C_SQ_TEX_WORD2_SRC_SEL_X 0xFF8FFFFF 523 #define S_SQ_TEX_WORD2_SRC_SEL_Y(x) (((unsigned)(x) & 0x7) << 23) 524 #define G_SQ_TEX_WORD2_SRC_SEL_Y(x) (((x) >> 23) & 0x7) 525 #define C_SQ_TEX_WORD2_SRC_SEL_Y 0xFC7FFFFF 526 #define S_SQ_TEX_WORD2_SRC_SEL_Z(x) (((unsigned)(x) & 0x7) << 26) 527 #define G_SQ_TEX_WORD2_SRC_SEL_Z(x) (((x) >> 26) & 0x7) 528 #define C_SQ_TEX_WORD2_SRC_SEL_Z 0xE3FFFFFF 529 #define S_SQ_TEX_WORD2_SRC_SEL_W(x) (((unsigned)(x) & 0x7) << 29) 530 #define G_SQ_TEX_WORD2_SRC_SEL_W(x) (((x) >> 29) & 0x7) 531 #define C_SQ_TEX_WORD2_SRC_SEL_W 0x1FFFFFFF 532 533 #define P_SQ_MEM_GDS_WORD0 534 #define S_SQ_MEM_GDS_WORD0_MEM_INST(x) (((unsigned)(x) & 0x1f) << 0) 535 #define S_SQ_MEM_GDS_WORD0_MEM_OP(x) (((unsigned)(x) & 0x7) << 8) 536 #define S_SQ_MEM_GDS_WORD0_SRC_GPR(x) (((unsigned)(x) & 0x7f) << 11) 537 #define S_SQ_MEM_GDS_WORD0_SRC_REL(x) (((unsigned)(x) & 0x3) << 18) 538 #define S_SQ_MEM_GDS_WORD0_SRC_SEL_X(x) (((unsigned)(x) & 0x7) << 20) 539 #define S_SQ_MEM_GDS_WORD0_SRC_SEL_Y(x) (((unsigned)(x) & 0x7) << 23) 540 #define S_SQ_MEM_GDS_WORD0_SRC_SEL_Z(x) (((unsigned)(x) & 0x7) << 26) 541 542 #define P_SQ_MEM_GDS_WORD1 543 #define S_SQ_MEM_GDS_WORD1_DST_GPR(x) (((unsigned)(x) & 0x7f) << 0) 544 #define S_SQ_MEM_GDS_WORD1_DST_REL(x) (((unsigned)(x) & 0x3) << 7) 545 #define S_SQ_MEM_GDS_WORD1_GDS_OP(x) (((unsigned)(x) & 0x3f) << 9) 546 #define S_SQ_MEM_GDS_WORD1_SRC_GPR(x) (((unsigned)(x) & 0x7f) << 16) 547 #define S_SQ_MEM_GDS_WORD1_UAV_INDEX_MODE(x) (((unsigned)(x) & 0x3) << 24) 548 #define S_SQ_MEM_GDS_WORD1_UAV_ID(x) (((unsigned)(x) & 0xf) << 26) 549 #define S_SQ_MEM_GDS_WORD1_ALLOC_CONSUME(x) (((unsigned)(x) & 0x1) << 30) 550 #define S_SQ_MEM_GDS_WORD1_BCAST_FIRST_REQ(x) (((unsigned)(x) & 0x1) << 31) 551 552 #define P_SQ_MEM_GDS_WORD2 553 #define S_SQ_MEM_GDS_WORD2_DST_SEL_X(x) (((unsigned)(x) & 0x7) << 0) 554 #define S_SQ_MEM_GDS_WORD2_DST_SEL_Y(x) (((unsigned)(x) & 0x7) << 3) 555 #define S_SQ_MEM_GDS_WORD2_DST_SEL_Z(x) (((unsigned)(x) & 0x7) << 6) 556 #define S_SQ_MEM_GDS_WORD2_DST_SEL_W(x) (((unsigned)(x) & 0x7) << 9) 557 558 /* LDS IDX redefines the neg bits on op3 */ 559 #define S_SQ_ALU_WORD0_LDS_IDX_OP_IDX_OFFSET_4(x) (((unsigned)(x) & 0x1) << 12) 560 #define S_SQ_ALU_WORD0_LDS_IDX_OP_IDX_OFFSET_5(x) (((unsigned)(x) & 0x1) << 25) 561 562 /* src2 neg */ 563 #define S_SQ_ALU_WORD1_LDS_IDX_OP_IDX_OFFSET_1(x) (((unsigned)(x) & 0x1) << 12) 564 565 /* this was dst gpr */ 566 #define S_SQ_ALU_WORD1_LDS_IDX_OP_LDS_OP(x) (((unsigned)(x) & 0x3f) << 21) 567 #define S_SQ_ALU_WORD1_LDS_IDX_OP_IDX_OFFSET_0(x) (((unsigned)(x) & 0x1) << 27) 568 569 /* this was dst rel */ 570 #define S_SQ_ALU_WORD1_LDS_IDX_OP_IDX_OFFSET_2(x) (((unsigned)(x) & 0x1) << 28) 571 /* this was clamp */ 572 #define S_SQ_ALU_WORD1_LDS_IDX_OP_IDX_OFFSET_3(x) (((unsigned)(x) & 0x1) << 31) 573 574 #define EG_V_SQ_ALU_SRC_LDS_OQ_A_POP 0x000000DD 575 #define EG_V_SQ_ALU_SRC_LDS_OQ_B_POP 0x000000DE 576 577 578 #define V_SQ_LDS_INST_ADD 0x00 579 #define V_SQ_LDS_INST_SUB 0x01 580 #define V_SQ_LDS_INST_RSUB 0x02 581 582 #define V_SQ_LDS_INST_INC 0x03 583 #define V_SQ_LDS_INST_DEC 0x04 584 #define V_SQ_LDS_INST_MIN_INT 0x05 585 #define V_SQ_LDS_INST_MAX_INT 0x06 586 #define V_SQ_LDS_INST_MIN_UINT 0x07 587 #define V_SQ_LDS_INST_MAX_UINT 0x08 588 #define V_SQ_LDS_INST_AND 0x09 589 #define V_SQ_LDS_INST_OR 0x0a 590 #define V_SQ_LDS_INST_XOR 0x0b 591 #define V_SQ_LDS_INST_MSKOR 0x0c 592 #define V_SQ_LDS_INST_WRITE 0x0d 593 #define V_SQ_LDS_INST_WRITE_REL 0x0e 594 #define V_SQ_LDS_INST_WRITE2 0x0f 595 596 #define V_SQ_LDS_INST_READ_RET 0x32 597 #define V_SQ_LDS_INST_READ_REL_RET 0x33 598 #define V_SQ_LDS_INST_READ2_RET 0x34 599 #define V_SQ_LDS_INST_READWRITE_RET 0x35 600 601 #define V_SQ_CF_COND_ACTIVE 0x00 602 #define V_SQ_CF_COND_FALSE 0x01 603 #define V_SQ_CF_COND_BOOL 0x02 604 #define V_SQ_CF_COND_NOT_BOOL 0x03 605 606 #define V_SQ_REL_ABSOLUTE 0 607 #define V_SQ_REL_RELATIVE 1 608 609 /* CAYMAN has special encoding for MOVA_INT destination */ 610 #define CM_V_SQ_MOVA_DST_AR_X 0 611 #define CM_V_SQ_MOVA_DST_CF_PC 1 612 #define CM_V_SQ_MOVA_DST_CF_IDX0 2 613 #define CM_V_SQ_MOVA_DST_CF_IDX1 3 614 615 #endif 616