2 * Copyright 2010 Jerome Glisse <glisse@freedesktop.org>
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:
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
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.
24 #include "r600_context.h"
25 #include "util/u_memory.h"
30 int r700_bc_alu_build(struct r600_bc
*bc
, struct r600_bc_alu
*alu
, unsigned id
);
32 static struct r600_bc_cf
*r600_bc_cf(void)
34 struct r600_bc_cf
*cf
= CALLOC_STRUCT(r600_bc_cf
);
38 LIST_INITHEAD(&cf
->list
);
39 LIST_INITHEAD(&cf
->alu
);
40 LIST_INITHEAD(&cf
->vtx
);
41 LIST_INITHEAD(&cf
->tex
);
45 static struct r600_bc_alu
*r600_bc_alu(void)
47 struct r600_bc_alu
*alu
= CALLOC_STRUCT(r600_bc_alu
);
51 LIST_INITHEAD(&alu
->list
);
55 static struct r600_bc_vtx
*r600_bc_vtx(void)
57 struct r600_bc_vtx
*vtx
= CALLOC_STRUCT(r600_bc_vtx
);
61 LIST_INITHEAD(&vtx
->list
);
65 static struct r600_bc_tex
*r600_bc_tex(void)
67 struct r600_bc_tex
*tex
= CALLOC_STRUCT(r600_bc_tex
);
71 LIST_INITHEAD(&tex
->list
);
75 int r600_bc_init(struct r600_bc
*bc
, enum radeon_family family
)
77 LIST_INITHEAD(&bc
->cf
);
97 R600_ERR("unknown family %d\n", bc
->family
);
103 static int r600_bc_add_cf(struct r600_bc
*bc
)
105 struct r600_bc_cf
*cf
= r600_bc_cf();
109 LIST_ADDTAIL(&cf
->list
, &bc
->cf
);
111 cf
->id
= bc
->cf_last
->id
+ 2;
115 bc
->force_add_cf
= 0;
119 int r600_bc_add_output(struct r600_bc
*bc
, const struct r600_bc_output
*output
)
123 r
= r600_bc_add_cf(bc
);
126 bc
->cf_last
->inst
= output
->inst
;
127 memcpy(&bc
->cf_last
->output
, output
, sizeof(struct r600_bc_output
));
131 int r600_bc_add_alu_type(struct r600_bc
*bc
, const struct r600_bc_alu
*alu
, int type
)
133 struct r600_bc_alu
*nalu
= r600_bc_alu();
134 struct r600_bc_alu
*lalu
;
139 memcpy(nalu
, alu
, sizeof(struct r600_bc_alu
));
142 /* cf can contains only alu or only vtx or only tex */
143 if (bc
->cf_last
== NULL
|| bc
->cf_last
->inst
!= (type
<< 3) ||
145 /* at most 128 slots, one add alu can add 4 slots + 4 constant worst case */
146 r
= r600_bc_add_cf(bc
);
151 bc
->cf_last
->inst
= (type
<< 3);
153 if (alu
->last
&& (bc
->cf_last
->ndw
>> 1) >= 124) {
154 bc
->force_add_cf
= 1;
156 /* number of gpr == the last gpr used in any alu */
157 for (i
= 0; i
< 3; i
++) {
158 if (alu
->src
[i
].sel
>= bc
->ngpr
&& alu
->src
[i
].sel
< 128) {
159 bc
->ngpr
= alu
->src
[i
].sel
+ 1;
161 /* compute how many literal are needed
162 * either 2 or 4 literals
164 if (alu
->src
[i
].sel
== 253) {
165 if (((alu
->src
[i
].chan
+ 2) & 0x6) > nalu
->nliteral
) {
166 nalu
->nliteral
= (alu
->src
[i
].chan
+ 2) & 0x6;
170 if (!LIST_IS_EMPTY(&bc
->cf_last
->alu
)) {
171 lalu
= LIST_ENTRY(struct r600_bc_alu
, bc
->cf_last
->alu
.prev
, list
);
172 if (!lalu
->last
&& lalu
->nliteral
> nalu
->nliteral
) {
173 nalu
->nliteral
= lalu
->nliteral
;
176 if (alu
->dst
.sel
>= bc
->ngpr
) {
177 bc
->ngpr
= alu
->dst
.sel
+ 1;
179 LIST_ADDTAIL(&nalu
->list
, &bc
->cf_last
->alu
);
180 /* each alu use 2 dwords */
181 bc
->cf_last
->ndw
+= 2;
184 if (bc
->use_mem_constant
)
185 bc
->cf_last
->kcache0_mode
= 2;
190 int r600_bc_add_alu(struct r600_bc
*bc
, const struct r600_bc_alu
*alu
)
192 return r600_bc_add_alu_type(bc
, alu
, V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU
);
195 int r600_bc_add_literal(struct r600_bc
*bc
, const u32
*value
)
197 struct r600_bc_alu
*alu
;
199 if (bc
->cf_last
== NULL
) {
202 if (bc
->cf_last
->inst
== V_SQ_CF_WORD1_SQ_CF_INST_TEX
) {
205 if (bc
->cf_last
->inst
== V_SQ_CF_WORD1_SQ_CF_INST_JUMP
||
206 bc
->cf_last
->inst
== V_SQ_CF_WORD1_SQ_CF_INST_ELSE
||
207 bc
->cf_last
->inst
== V_SQ_CF_WORD1_SQ_CF_INST_LOOP_START_NO_AL
||
208 bc
->cf_last
->inst
== V_SQ_CF_WORD1_SQ_CF_INST_LOOP_BREAK
||
209 bc
->cf_last
->inst
== V_SQ_CF_WORD1_SQ_CF_INST_LOOP_CONTINUE
||
210 bc
->cf_last
->inst
== V_SQ_CF_WORD1_SQ_CF_INST_LOOP_END
||
211 bc
->cf_last
->inst
== V_SQ_CF_WORD1_SQ_CF_INST_POP
) {
214 if (((bc
->cf_last
->inst
!= (V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU
<< 3)) &&
215 (bc
->cf_last
->inst
!= (V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU_PUSH_BEFORE
<< 3))) ||
216 LIST_IS_EMPTY(&bc
->cf_last
->alu
)) {
217 R600_ERR("last CF is not ALU (%p)\n", bc
->cf_last
);
220 alu
= LIST_ENTRY(struct r600_bc_alu
, bc
->cf_last
->alu
.prev
, list
);
221 if (!alu
->last
|| !alu
->nliteral
|| alu
->literal_added
) {
224 memcpy(alu
->value
, value
, 4 * 4);
225 bc
->cf_last
->ndw
+= alu
->nliteral
;
226 bc
->ndw
+= alu
->nliteral
;
227 alu
->literal_added
= 1;
231 int r600_bc_add_vtx(struct r600_bc
*bc
, const struct r600_bc_vtx
*vtx
)
233 struct r600_bc_vtx
*nvtx
= r600_bc_vtx();
238 memcpy(nvtx
, vtx
, sizeof(struct r600_bc_vtx
));
240 /* cf can contains only alu or only vtx or only tex */
241 if (bc
->cf_last
== NULL
||
242 (bc
->cf_last
->inst
!= V_SQ_CF_WORD1_SQ_CF_INST_VTX
&&
243 bc
->cf_last
->inst
!= V_SQ_CF_WORD1_SQ_CF_INST_VTX_TC
)) {
244 r
= r600_bc_add_cf(bc
);
249 bc
->cf_last
->inst
= V_SQ_CF_WORD1_SQ_CF_INST_VTX
;
251 LIST_ADDTAIL(&nvtx
->list
, &bc
->cf_last
->vtx
);
252 /* each fetch use 4 dwords */
253 bc
->cf_last
->ndw
+= 4;
258 int r600_bc_add_tex(struct r600_bc
*bc
, const struct r600_bc_tex
*tex
)
260 struct r600_bc_tex
*ntex
= r600_bc_tex();
265 memcpy(ntex
, tex
, sizeof(struct r600_bc_tex
));
267 /* cf can contains only alu or only vtx or only tex */
268 if (bc
->cf_last
== NULL
||
269 bc
->cf_last
->inst
!= V_SQ_CF_WORD1_SQ_CF_INST_TEX
) {
270 r
= r600_bc_add_cf(bc
);
275 bc
->cf_last
->inst
= V_SQ_CF_WORD1_SQ_CF_INST_TEX
;
277 LIST_ADDTAIL(&ntex
->list
, &bc
->cf_last
->tex
);
278 /* each texture fetch use 4 dwords */
279 bc
->cf_last
->ndw
+= 4;
284 int r600_bc_add_cfinst(struct r600_bc
*bc
, int inst
)
287 r
= r600_bc_add_cf(bc
);
291 bc
->cf_last
->cond
= V_SQ_CF_COND_ACTIVE
;
292 bc
->cf_last
->inst
= inst
;
296 static int r600_bc_vtx_build(struct r600_bc
*bc
, struct r600_bc_vtx
*vtx
, unsigned id
)
298 bc
->bytecode
[id
++] = S_SQ_VTX_WORD0_BUFFER_ID(vtx
->buffer_id
) |
299 S_SQ_VTX_WORD0_SRC_GPR(vtx
->src_gpr
) |
300 S_SQ_VTX_WORD0_SRC_SEL_X(vtx
->src_sel_x
) |
301 S_SQ_VTX_WORD0_MEGA_FETCH_COUNT(vtx
->mega_fetch_count
);
302 bc
->bytecode
[id
++] = S_SQ_VTX_WORD1_DST_SEL_X(vtx
->dst_sel_x
) |
303 S_SQ_VTX_WORD1_DST_SEL_Y(vtx
->dst_sel_y
) |
304 S_SQ_VTX_WORD1_DST_SEL_Z(vtx
->dst_sel_z
) |
305 S_SQ_VTX_WORD1_DST_SEL_W(vtx
->dst_sel_w
) |
306 S_SQ_VTX_WORD1_USE_CONST_FIELDS(1) |
307 S_SQ_VTX_WORD1_GPR_DST_GPR(vtx
->dst_gpr
);
308 bc
->bytecode
[id
++] = S_SQ_VTX_WORD2_MEGA_FETCH(1);
309 bc
->bytecode
[id
++] = 0;
313 static int r600_bc_tex_build(struct r600_bc
*bc
, struct r600_bc_tex
*tex
, unsigned id
)
315 bc
->bytecode
[id
++] = S_SQ_TEX_WORD0_TEX_INST(tex
->inst
) |
316 S_SQ_TEX_WORD0_RESOURCE_ID(tex
->resource_id
) |
317 S_SQ_TEX_WORD0_SRC_GPR(tex
->src_gpr
) |
318 S_SQ_TEX_WORD0_SRC_REL(tex
->src_rel
);
319 bc
->bytecode
[id
++] = S_SQ_TEX_WORD1_DST_GPR(tex
->dst_gpr
) |
320 S_SQ_TEX_WORD1_DST_REL(tex
->dst_rel
) |
321 S_SQ_TEX_WORD1_DST_SEL_X(tex
->dst_sel_x
) |
322 S_SQ_TEX_WORD1_DST_SEL_Y(tex
->dst_sel_y
) |
323 S_SQ_TEX_WORD1_DST_SEL_Z(tex
->dst_sel_z
) |
324 S_SQ_TEX_WORD1_DST_SEL_W(tex
->dst_sel_w
) |
325 S_SQ_TEX_WORD1_LOD_BIAS(tex
->lod_bias
) |
326 S_SQ_TEX_WORD1_COORD_TYPE_X(tex
->coord_type_x
) |
327 S_SQ_TEX_WORD1_COORD_TYPE_Y(tex
->coord_type_y
) |
328 S_SQ_TEX_WORD1_COORD_TYPE_Z(tex
->coord_type_z
) |
329 S_SQ_TEX_WORD1_COORD_TYPE_W(tex
->coord_type_w
);
330 bc
->bytecode
[id
++] = S_SQ_TEX_WORD2_OFFSET_X(tex
->offset_x
) |
331 S_SQ_TEX_WORD2_OFFSET_Y(tex
->offset_y
) |
332 S_SQ_TEX_WORD2_OFFSET_Z(tex
->offset_z
) |
333 S_SQ_TEX_WORD2_SAMPLER_ID(tex
->sampler_id
) |
334 S_SQ_TEX_WORD2_SRC_SEL_X(tex
->src_sel_x
) |
335 S_SQ_TEX_WORD2_SRC_SEL_Y(tex
->src_sel_y
) |
336 S_SQ_TEX_WORD2_SRC_SEL_Z(tex
->src_sel_z
) |
337 S_SQ_TEX_WORD2_SRC_SEL_W(tex
->src_sel_w
);
338 bc
->bytecode
[id
++] = 0;
342 static int r600_bc_alu_build(struct r600_bc
*bc
, struct r600_bc_alu
*alu
, unsigned id
)
346 /* don't replace gpr by pv or ps for destination register */
347 bc
->bytecode
[id
++] = S_SQ_ALU_WORD0_SRC0_SEL(alu
->src
[0].sel
) |
348 S_SQ_ALU_WORD0_SRC0_REL(alu
->src
[0].rel
) |
349 S_SQ_ALU_WORD0_SRC0_CHAN(alu
->src
[0].chan
) |
350 S_SQ_ALU_WORD0_SRC0_NEG(alu
->src
[0].neg
) |
351 S_SQ_ALU_WORD0_SRC1_SEL(alu
->src
[1].sel
) |
352 S_SQ_ALU_WORD0_SRC1_REL(alu
->src
[1].rel
) |
353 S_SQ_ALU_WORD0_SRC1_CHAN(alu
->src
[1].chan
) |
354 S_SQ_ALU_WORD0_SRC1_NEG(alu
->src
[1].neg
) |
355 S_SQ_ALU_WORD0_LAST(alu
->last
);
358 bc
->bytecode
[id
++] = S_SQ_ALU_WORD1_DST_GPR(alu
->dst
.sel
) |
359 S_SQ_ALU_WORD1_DST_CHAN(alu
->dst
.chan
) |
360 S_SQ_ALU_WORD1_DST_REL(alu
->dst
.rel
) |
361 S_SQ_ALU_WORD1_CLAMP(alu
->dst
.clamp
) |
362 S_SQ_ALU_WORD1_OP3_SRC2_SEL(alu
->src
[2].sel
) |
363 S_SQ_ALU_WORD1_OP3_SRC2_REL(alu
->src
[2].rel
) |
364 S_SQ_ALU_WORD1_OP3_SRC2_CHAN(alu
->src
[2].chan
) |
365 S_SQ_ALU_WORD1_OP3_SRC2_NEG(alu
->src
[2].neg
) |
366 S_SQ_ALU_WORD1_OP3_ALU_INST(alu
->inst
) |
367 S_SQ_ALU_WORD1_BANK_SWIZZLE(0);
369 bc
->bytecode
[id
++] = S_SQ_ALU_WORD1_DST_GPR(alu
->dst
.sel
) |
370 S_SQ_ALU_WORD1_DST_CHAN(alu
->dst
.chan
) |
371 S_SQ_ALU_WORD1_DST_REL(alu
->dst
.rel
) |
372 S_SQ_ALU_WORD1_CLAMP(alu
->dst
.clamp
) |
373 S_SQ_ALU_WORD1_OP2_SRC0_ABS(alu
->src
[0].abs
) |
374 S_SQ_ALU_WORD1_OP2_SRC1_ABS(alu
->src
[1].abs
) |
375 S_SQ_ALU_WORD1_OP2_WRITE_MASK(alu
->dst
.write
) |
376 S_SQ_ALU_WORD1_OP2_ALU_INST(alu
->inst
) |
377 S_SQ_ALU_WORD1_BANK_SWIZZLE(0) |
378 S_SQ_ALU_WORD1_OP2_UPDATE_EXECUTE_MASK(alu
->predicate
) |
379 S_SQ_ALU_WORD1_OP2_UPDATE_PRED(alu
->predicate
);
382 if (alu
->nliteral
&& !alu
->literal_added
) {
383 R600_ERR("Bug in ALU processing for instruction 0x%08x, literal not added correctly\n", alu
->inst
);
385 for (i
= 0; i
< alu
->nliteral
; i
++) {
386 bc
->bytecode
[id
++] = alu
->value
[i
];
392 static int r600_bc_cf_build(struct r600_bc
*bc
, struct r600_bc_cf
*cf
)
394 unsigned id
= cf
->id
;
397 case (V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU
<< 3):
398 case (V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU_PUSH_BEFORE
<< 3):
399 bc
->bytecode
[id
++] = S_SQ_CF_ALU_WORD0_ADDR(cf
->addr
>> 1) |
400 S_SQ_CF_ALU_WORD0_KCACHE_MODE0(cf
->kcache0_mode
);
402 bc
->bytecode
[id
++] = S_SQ_CF_ALU_WORD1_CF_INST(cf
->inst
>> 3) |
403 S_SQ_CF_ALU_WORD1_BARRIER(1) |
404 S_SQ_CF_ALU_WORD1_COUNT((cf
->ndw
/ 2) - 1);
406 case V_SQ_CF_WORD1_SQ_CF_INST_TEX
:
407 case V_SQ_CF_WORD1_SQ_CF_INST_VTX
:
408 case V_SQ_CF_WORD1_SQ_CF_INST_VTX_TC
:
409 bc
->bytecode
[id
++] = S_SQ_CF_WORD0_ADDR(cf
->addr
>> 1);
410 bc
->bytecode
[id
++] = S_SQ_CF_WORD1_CF_INST(cf
->inst
) |
411 S_SQ_CF_WORD1_BARRIER(1) |
412 S_SQ_CF_WORD1_COUNT((cf
->ndw
/ 4) - 1);
414 case V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT
:
415 case V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT_DONE
:
416 bc
->bytecode
[id
++] = S_SQ_CF_ALLOC_EXPORT_WORD0_RW_GPR(cf
->output
.gpr
) |
417 S_SQ_CF_ALLOC_EXPORT_WORD0_ELEM_SIZE(cf
->output
.elem_size
) |
418 S_SQ_CF_ALLOC_EXPORT_WORD0_ARRAY_BASE(cf
->output
.array_base
) |
419 S_SQ_CF_ALLOC_EXPORT_WORD0_TYPE(cf
->output
.type
);
420 bc
->bytecode
[id
++] = S_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_X(cf
->output
.swizzle_x
) |
421 S_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_Y(cf
->output
.swizzle_y
) |
422 S_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_Z(cf
->output
.swizzle_z
) |
423 S_SQ_CF_ALLOC_EXPORT_WORD1_SWIZ_SEL_W(cf
->output
.swizzle_w
) |
424 S_SQ_CF_ALLOC_EXPORT_WORD1_BARRIER(cf
->output
.barrier
) |
425 S_SQ_CF_ALLOC_EXPORT_WORD1_CF_INST(cf
->output
.inst
) |
426 S_SQ_CF_ALLOC_EXPORT_WORD1_END_OF_PROGRAM(cf
->output
.end_of_program
);
428 case V_SQ_CF_WORD1_SQ_CF_INST_JUMP
:
429 case V_SQ_CF_WORD1_SQ_CF_INST_ELSE
:
430 case V_SQ_CF_WORD1_SQ_CF_INST_POP
:
431 case V_SQ_CF_WORD1_SQ_CF_INST_LOOP_START_NO_AL
:
432 case V_SQ_CF_WORD1_SQ_CF_INST_LOOP_END
:
433 case V_SQ_CF_WORD1_SQ_CF_INST_LOOP_CONTINUE
:
434 case V_SQ_CF_WORD1_SQ_CF_INST_LOOP_BREAK
:
435 bc
->bytecode
[id
++] = S_SQ_CF_WORD0_ADDR(cf
->cf_addr
>> 1);
436 bc
->bytecode
[id
++] = S_SQ_CF_WORD1_CF_INST(cf
->inst
) |
437 S_SQ_CF_WORD1_BARRIER(1) |
438 S_SQ_CF_WORD1_COND(cf
->cond
) |
439 S_SQ_CF_WORD1_POP_COUNT(cf
->pop_count
);
443 R600_ERR("unsupported CF instruction (0x%X)\n", cf
->inst
);
449 int r600_bc_build(struct r600_bc
*bc
)
451 struct r600_bc_cf
*cf
;
452 struct r600_bc_alu
*alu
;
453 struct r600_bc_vtx
*vtx
;
454 struct r600_bc_tex
*tex
;
458 if (bc
->callstack
[0].max
> 0)
459 bc
->nstack
= ((bc
->callstack
[0].max
+ 3) >> 2) + 2;
461 /* first path compute addr of each CF block */
462 /* addr start after all the CF instructions */
463 addr
= bc
->cf_last
->id
+ 2;
464 LIST_FOR_EACH_ENTRY(cf
, &bc
->cf
, list
) {
466 case (V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU
<< 3):
467 case (V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU_PUSH_BEFORE
<< 3):
469 case V_SQ_CF_WORD1_SQ_CF_INST_TEX
:
470 case V_SQ_CF_WORD1_SQ_CF_INST_VTX
:
471 case V_SQ_CF_WORD1_SQ_CF_INST_VTX_TC
:
472 /* fetch node need to be 16 bytes aligned*/
474 addr
&= 0xFFFFFFFCUL
;
476 case V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT
:
477 case V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT_DONE
:
479 case V_SQ_CF_WORD1_SQ_CF_INST_JUMP
:
480 case V_SQ_CF_WORD1_SQ_CF_INST_ELSE
:
481 case V_SQ_CF_WORD1_SQ_CF_INST_POP
:
482 case V_SQ_CF_WORD1_SQ_CF_INST_LOOP_START_NO_AL
:
483 case V_SQ_CF_WORD1_SQ_CF_INST_LOOP_END
:
484 case V_SQ_CF_WORD1_SQ_CF_INST_LOOP_CONTINUE
:
485 case V_SQ_CF_WORD1_SQ_CF_INST_LOOP_BREAK
:
488 R600_ERR("unsupported CF instruction (0x%X)\n", cf
->inst
);
493 bc
->ndw
= cf
->addr
+ cf
->ndw
;
496 bc
->bytecode
= calloc(1, bc
->ndw
* 4);
497 if (bc
->bytecode
== NULL
)
499 LIST_FOR_EACH_ENTRY(cf
, &bc
->cf
, list
) {
501 r
= r600_bc_cf_build(bc
, cf
);
505 case (V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU
<< 3):
506 case (V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU_PUSH_BEFORE
<< 3):
507 LIST_FOR_EACH_ENTRY(alu
, &cf
->alu
, list
) {
508 switch(bc
->chiprev
) {
510 r
= r600_bc_alu_build(bc
, alu
, addr
);
513 r
= r700_bc_alu_build(bc
, alu
, addr
);
516 R600_ERR("unknown family %d\n", bc
->family
);
523 addr
+= alu
->nliteral
;
527 case V_SQ_CF_WORD1_SQ_CF_INST_VTX
:
528 case V_SQ_CF_WORD1_SQ_CF_INST_VTX_TC
:
529 LIST_FOR_EACH_ENTRY(vtx
, &cf
->vtx
, list
) {
530 r
= r600_bc_vtx_build(bc
, vtx
, addr
);
536 case V_SQ_CF_WORD1_SQ_CF_INST_TEX
:
537 LIST_FOR_EACH_ENTRY(tex
, &cf
->tex
, list
) {
538 r
= r600_bc_tex_build(bc
, tex
, addr
);
544 case V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT
:
545 case V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT_DONE
:
546 case V_SQ_CF_WORD1_SQ_CF_INST_LOOP_START_NO_AL
:
547 case V_SQ_CF_WORD1_SQ_CF_INST_LOOP_END
:
548 case V_SQ_CF_WORD1_SQ_CF_INST_LOOP_CONTINUE
:
549 case V_SQ_CF_WORD1_SQ_CF_INST_LOOP_BREAK
:
550 case V_SQ_CF_WORD1_SQ_CF_INST_JUMP
:
551 case V_SQ_CF_WORD1_SQ_CF_INST_ELSE
:
552 case V_SQ_CF_WORD1_SQ_CF_INST_POP
:
555 R600_ERR("unsupported CF instruction (0x%X)\n", cf
->inst
);