Lines Matching refs:alu
36 …nsigned int r600_bytecode_get_num_operands(struct r600_bytecode *bc, struct r600_bytecode_alu *alu) in r600_bytecode_get_num_operands() argument
38 if(alu->is_op3) in r600_bytecode_get_num_operands()
44 switch (alu->inst) { in r600_bytecode_get_num_operands()
121 "Need instruction operand number for 0x%x.\n", alu->inst); in r600_bytecode_get_num_operands()
126 switch (alu->inst) { in r600_bytecode_get_num_operands()
204 "Need instruction operand number for 0x%x.\n", alu->inst); in r600_bytecode_get_num_operands()
212 int r700_bytecode_alu_build(struct r600_bytecode *bc, struct r600_bytecode_alu *alu, unsigned id);
221 LIST_INITHEAD(&cf->alu); in r600_bytecode_cf()
229 struct r600_bytecode_alu *alu = CALLOC_STRUCT(r600_bytecode_alu); in r600_bytecode_alu() local
231 if (alu == NULL) in r600_bytecode_alu()
233 LIST_INITHEAD(&alu->list); in r600_bytecode_alu()
234 return alu; in r600_bytecode_alu()
342 static int is_alu_once_inst(struct r600_bytecode *bc, struct r600_bytecode_alu *alu) in is_alu_once_inst() argument
347 return !alu->is_op3 && ( in is_alu_once_inst()
348 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLE || in is_alu_once_inst()
349 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLGT || in is_alu_once_inst()
350 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLGE || in is_alu_once_inst()
351 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLNE || in is_alu_once_inst()
352 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLGT_UINT || in is_alu_once_inst()
353 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLGE_UINT || in is_alu_once_inst()
354 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLE_INT || in is_alu_once_inst()
355 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLGT_INT || in is_alu_once_inst()
356 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLGE_INT || in is_alu_once_inst()
357 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLNE_INT || in is_alu_once_inst()
358 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETGT_UINT || in is_alu_once_inst()
359 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETGE_UINT || in is_alu_once_inst()
360 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETE || in is_alu_once_inst()
361 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETGT || in is_alu_once_inst()
362 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETGE || in is_alu_once_inst()
363 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETNE || in is_alu_once_inst()
364 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SET_INV || in is_alu_once_inst()
365 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SET_POP || in is_alu_once_inst()
366 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SET_CLR || in is_alu_once_inst()
367 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SET_RESTORE || in is_alu_once_inst()
368 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETE_PUSH || in is_alu_once_inst()
369 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETGT_PUSH || in is_alu_once_inst()
370 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETGE_PUSH || in is_alu_once_inst()
371 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETNE_PUSH || in is_alu_once_inst()
372 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETE_INT || in is_alu_once_inst()
373 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETGT_INT || in is_alu_once_inst()
374 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETGE_INT || in is_alu_once_inst()
375 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETNE_INT || in is_alu_once_inst()
376 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETE_PUSH_INT || in is_alu_once_inst()
377 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETGT_PUSH_INT || in is_alu_once_inst()
378 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETGE_PUSH_INT || in is_alu_once_inst()
379 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETNE_PUSH_INT || in is_alu_once_inst()
380 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETLT_PUSH_INT || in is_alu_once_inst()
381 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETLE_PUSH_INT); in is_alu_once_inst()
385 return !alu->is_op3 && ( in is_alu_once_inst()
386 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLE || in is_alu_once_inst()
387 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLGT || in is_alu_once_inst()
388 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLGE || in is_alu_once_inst()
389 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLNE || in is_alu_once_inst()
390 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLGT_UINT || in is_alu_once_inst()
391 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLGE_UINT || in is_alu_once_inst()
392 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLE_INT || in is_alu_once_inst()
393 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLGT_INT || in is_alu_once_inst()
394 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLGE_INT || in is_alu_once_inst()
395 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLNE_INT || in is_alu_once_inst()
396 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETGT_UINT || in is_alu_once_inst()
397 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETGE_UINT || in is_alu_once_inst()
398 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETE || in is_alu_once_inst()
399 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETGT || in is_alu_once_inst()
400 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETGE || in is_alu_once_inst()
401 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETNE || in is_alu_once_inst()
402 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SET_INV || in is_alu_once_inst()
403 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SET_POP || in is_alu_once_inst()
404 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SET_CLR || in is_alu_once_inst()
405 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SET_RESTORE || in is_alu_once_inst()
406 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETE_PUSH || in is_alu_once_inst()
407 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETGT_PUSH || in is_alu_once_inst()
408 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETGE_PUSH || in is_alu_once_inst()
409 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETNE_PUSH || in is_alu_once_inst()
410 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETE_INT || in is_alu_once_inst()
411 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETGT_INT || in is_alu_once_inst()
412 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETGE_INT || in is_alu_once_inst()
413 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETNE_INT || in is_alu_once_inst()
414 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETE_PUSH_INT || in is_alu_once_inst()
415 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETGT_PUSH_INT || in is_alu_once_inst()
416 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETGE_PUSH_INT || in is_alu_once_inst()
417 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETNE_PUSH_INT || in is_alu_once_inst()
418 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETLT_PUSH_INT || in is_alu_once_inst()
419 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETLE_PUSH_INT); in is_alu_once_inst()
423 static int is_alu_reduction_inst(struct r600_bytecode *bc, struct r600_bytecode_alu *alu) in is_alu_reduction_inst() argument
428 return !alu->is_op3 && ( in is_alu_reduction_inst()
429 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_CUBE || in is_alu_reduction_inst()
430 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_DOT4 || in is_alu_reduction_inst()
431 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_DOT4_IEEE || in is_alu_reduction_inst()
432 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MAX4); in is_alu_reduction_inst()
436 return !alu->is_op3 && ( in is_alu_reduction_inst()
437 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_CUBE || in is_alu_reduction_inst()
438 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_DOT4 || in is_alu_reduction_inst()
439 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_DOT4_IEEE || in is_alu_reduction_inst()
440 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MAX4); in is_alu_reduction_inst()
444 static int is_alu_cube_inst(struct r600_bytecode *bc, struct r600_bytecode_alu *alu) in is_alu_cube_inst() argument
449 return !alu->is_op3 && in is_alu_cube_inst()
450 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_CUBE; in is_alu_cube_inst()
454 return !alu->is_op3 && in is_alu_cube_inst()
455 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_CUBE; in is_alu_cube_inst()
459 static int is_alu_mova_inst(struct r600_bytecode *bc, struct r600_bytecode_alu *alu) in is_alu_mova_inst() argument
464 return !alu->is_op3 && ( in is_alu_mova_inst()
465 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOVA || in is_alu_mova_inst()
466 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOVA_FLOOR || in is_alu_mova_inst()
467 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOVA_INT || in is_alu_mova_inst()
468 alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOVA_GPR_INT); in is_alu_mova_inst()
472 return !alu->is_op3 && ( in is_alu_mova_inst()
473 alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOVA_INT); in is_alu_mova_inst()
493 static int is_alu_vec_unit_inst(struct r600_bytecode *bc, struct r600_bytecode_alu *alu) in is_alu_vec_unit_inst() argument
498 if (alu->is_op3) in is_alu_vec_unit_inst()
499 return is_opcode_in_range(alu->inst, in is_alu_vec_unit_inst()
503 return (alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_FREXP_64) || in is_alu_vec_unit_inst()
504 is_opcode_in_range(alu->inst, in is_alu_vec_unit_inst()
507 is_opcode_in_range(alu->inst, in is_alu_vec_unit_inst()
510 is_opcode_in_range(alu->inst, in is_alu_vec_unit_inst()
513 is_opcode_in_range(alu->inst, in is_alu_vec_unit_inst()
518 if (alu->is_op3) in is_alu_vec_unit_inst()
519 return is_opcode_in_range(alu->inst, in is_alu_vec_unit_inst()
523 return is_opcode_in_range(alu->inst, in is_alu_vec_unit_inst()
548 static int is_alu_trans_unit_inst(struct r600_bytecode *bc, struct r600_bytecode_alu *alu) in is_alu_trans_unit_inst() argument
553 if (alu->is_op3) in is_alu_trans_unit_inst()
554 return alu->inst == V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_MUL_LIT; in is_alu_trans_unit_inst()
556 return is_opcode_in_range(alu->inst, in is_alu_trans_unit_inst()
560 if (alu->is_op3) in is_alu_trans_unit_inst()
561 return alu->inst == V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_MUL_LIT; in is_alu_trans_unit_inst()
563 return is_opcode_in_range(alu->inst, in is_alu_trans_unit_inst()
566 is_opcode_in_range(alu->inst, in is_alu_trans_unit_inst()
570 if (alu->is_op3) in is_alu_trans_unit_inst()
571 return alu->inst == EG_V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_MUL_LIT; in is_alu_trans_unit_inst()
573 return is_opcode_in_range(alu->inst, in is_alu_trans_unit_inst()
584 static int is_alu_any_unit_inst(struct r600_bytecode *bc, struct r600_bytecode_alu *alu) in is_alu_any_unit_inst() argument
586 return !is_alu_vec_unit_inst(bc, alu) && in is_alu_any_unit_inst()
587 !is_alu_trans_unit_inst(bc, alu); in is_alu_any_unit_inst()
590 static int is_nop_inst(struct r600_bytecode *bc, struct r600_bytecode_alu *alu) in is_nop_inst() argument
595 return (!alu->is_op3 && alu->inst == V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP); in is_nop_inst()
599 return (!alu->is_op3 && alu->inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP); in is_nop_inst()
606 struct r600_bytecode_alu *alu; in assign_alu_units() local
613 for (alu = alu_first; alu; alu = LIST_ENTRY(struct r600_bytecode_alu, alu->list.next, list)) { in assign_alu_units()
614 chan = alu->dst.chan; in assign_alu_units()
617 else if (is_alu_trans_unit_inst(bc, alu)) in assign_alu_units()
619 else if (is_alu_vec_unit_inst(bc, alu)) in assign_alu_units()
631 assignment[4] = alu; in assign_alu_units()
637 assignment[chan] = alu; in assign_alu_units()
640 if (alu->last) in assign_alu_units()
734 static int check_vector(struct r600_bytecode *bc, struct r600_bytecode_alu *alu, in check_vector() argument
739 num_src = r600_bytecode_get_num_operands(bc, alu); in check_vector()
741 sel = alu->src[src].sel; in check_vector()
742 elem = alu->src[src].chan; in check_vector()
745 if (src == 1 && sel == alu->src[0].sel && elem == alu->src[0].chan) in check_vector()
755 r = reserve_cfile(bc, bs, (alu->src[src].kc_bank<<16) + sel, elem); in check_vector()
764 static int check_scalar(struct r600_bytecode *bc, struct r600_bytecode_alu *alu, in check_scalar() argument
769 num_src = r600_bytecode_get_num_operands(bc, alu); in check_scalar()
771 sel = alu->src[src].sel; in check_scalar()
772 elem = alu->src[src].chan; in check_scalar()
782 r = reserve_cfile(bc, bs, (alu->src[src].kc_bank<<16) + sel, elem); in check_scalar()
788 sel = alu->src[src].sel; in check_scalar()
789 elem = alu->src[src].chan; in check_scalar()
918 struct r600_bytecode_alu *alu = slots[i]; in replace_gpr_with_pv_ps() local
919 if(!alu) in replace_gpr_with_pv_ps()
922 num_src = r600_bytecode_get_num_operands(bc, alu); in replace_gpr_with_pv_ps()
924 if (!is_gpr(alu->src[src].sel) || alu->src[src].rel) in replace_gpr_with_pv_ps()
928 if (alu->src[src].sel == gpr[4] && in replace_gpr_with_pv_ps()
929 alu->src[src].chan == chan[4] && in replace_gpr_with_pv_ps()
930 alu_prev->pred_sel == alu->pred_sel) { in replace_gpr_with_pv_ps()
931 alu->src[src].sel = V_SQ_ALU_SRC_PS; in replace_gpr_with_pv_ps()
932 alu->src[src].chan = 0; in replace_gpr_with_pv_ps()
938 if (alu->src[src].sel == gpr[j] && in replace_gpr_with_pv_ps()
939 alu->src[src].chan == j && in replace_gpr_with_pv_ps()
940 alu_prev->pred_sel == alu->pred_sel) { in replace_gpr_with_pv_ps()
941 alu->src[src].sel = V_SQ_ALU_SRC_PV; in replace_gpr_with_pv_ps()
942 alu->src[src].chan = chan[j]; in replace_gpr_with_pv_ps()
985 static int r600_bytecode_alu_nliterals(struct r600_bytecode *bc, struct r600_bytecode_alu *alu, in r600_bytecode_alu_nliterals() argument
988 unsigned num_src = r600_bytecode_get_num_operands(bc, alu); in r600_bytecode_alu_nliterals()
992 if (alu->src[i].sel == V_SQ_ALU_SRC_LITERAL) { in r600_bytecode_alu_nliterals()
993 uint32_t value = alu->src[i].value; in r600_bytecode_alu_nliterals()
1012 struct r600_bytecode_alu *alu, in r600_bytecode_alu_adjust_literals() argument
1015 unsigned num_src = r600_bytecode_get_num_operands(bc, alu); in r600_bytecode_alu_adjust_literals()
1019 if (alu->src[i].sel == V_SQ_ALU_SRC_LITERAL) { in r600_bytecode_alu_adjust_literals()
1020 uint32_t value = alu->src[i].value; in r600_bytecode_alu_adjust_literals()
1023 alu->src[i].chan = j; in r600_bytecode_alu_adjust_literals()
1065 struct r600_bytecode_alu *alu; in merge_inst_groups() local
1121 alu = slots[i]; in merge_inst_groups()
1122 num_once_inst += is_alu_once_inst(bc, alu); in merge_inst_groups()
1125 if (is_nop_inst(bc, alu)) in merge_inst_groups()
1129 if (alu->dst.rel) { in merge_inst_groups()
1136 num_src = r600_bytecode_get_num_operands(bc, alu); in merge_inst_groups()
1138 if (alu->src[src].rel) { in merge_inst_groups()
1145 if (!is_gpr(alu->src[src].sel)) in merge_inst_groups()
1153 if (prev[j]->dst.chan == alu->src[src].chan && in merge_inst_groups()
1154 (prev[j]->dst.sel == alu->src[src].sel || in merge_inst_groups()
1155 prev[j]->dst.rel || alu->src[src].rel)) in merge_inst_groups()
1181 LIST_ADDTAIL(&result[i]->list, &bc->cf_last->alu); in merge_inst_groups()
1186 LIST_ENTRY(struct r600_bytecode_alu, bc->cf_last->alu.prev, list)->last = 1; in merge_inst_groups()
1265 struct r600_bytecode_alu *alu) in r600_bytecode_alloc_inst_kcache_lines() argument
1270 unsigned bank, line, sel = alu->src[i].sel; in r600_bytecode_alloc_inst_kcache_lines()
1275 bank = alu->src[i].kc_bank; in r600_bytecode_alloc_inst_kcache_lines()
1285 struct r600_bytecode_alu *alu, in r600_bytecode_assign_kcache_banks() argument
1293 unsigned int line, sel = alu->src[i].sel, found = 0; in r600_bytecode_assign_kcache_banks()
1308 if (kcache[j].bank == alu->src[i].kc_bank && in r600_bytecode_assign_kcache_banks()
1311 alu->src[i].sel = sel - (kcache[j].addr<<4); in r600_bytecode_assign_kcache_banks()
1312 alu->src[i].sel += base[j]; in r600_bytecode_assign_kcache_banks()
1321 static int r600_bytecode_alloc_kcache_lines(struct r600_bytecode *bc, struct r600_bytecode_alu *alu… in r600_bytecode_alloc_kcache_lines() argument
1329 if ((r = r600_bytecode_alloc_inst_kcache_lines(bc, kcache, alu))) { in r600_bytecode_alloc_kcache_lines()
1338 if ((r = r600_bytecode_alloc_inst_kcache_lines(bc, kcache, alu))) { in r600_bytecode_alloc_kcache_lines()
1359 struct r600_bytecode_alu alu; in insert_nop_r6xx() local
1363 memset(&alu, 0, sizeof(alu)); in insert_nop_r6xx()
1364 alu.inst = V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP; in insert_nop_r6xx()
1365 alu.src[0].chan = i; in insert_nop_r6xx()
1366 alu.dst.chan = i; in insert_nop_r6xx()
1367 alu.last = (i == 3); in insert_nop_r6xx()
1368 r = r600_bytecode_add_alu(bc, &alu); in insert_nop_r6xx()
1378 struct r600_bytecode_alu alu; in load_ar_r6xx() local
1388 memset(&alu, 0, sizeof(alu)); in load_ar_r6xx()
1389 alu.inst = V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOVA_GPR_INT; in load_ar_r6xx()
1390 alu.src[0].sel = bc->ar_reg; in load_ar_r6xx()
1391 alu.last = 1; in load_ar_r6xx()
1392 alu.index_mode = INDEX_MODE_LOOP; in load_ar_r6xx()
1393 r = r600_bytecode_add_alu(bc, &alu); in load_ar_r6xx()
1405 struct r600_bytecode_alu alu; in load_ar() local
1418 memset(&alu, 0, sizeof(alu)); in load_ar()
1419 alu.inst = BC_INST(bc, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOVA_INT); in load_ar()
1420 alu.src[0].sel = bc->ar_reg; in load_ar()
1421 alu.last = 1; in load_ar()
1422 r = r600_bytecode_add_alu(bc, &alu); in load_ar()
1431 int r600_bytecode_add_alu_type(struct r600_bytecode *bc, const struct r600_bytecode_alu *alu, int t… in r600_bytecode_add_alu_type() argument
1439 memcpy(nalu, alu, sizeof(struct r600_bytecode_alu)); in r600_bytecode_add_alu_type()
1445 LIST_FOR_EACH_ENTRY(lalu, &bc->cf_last->alu, list) { in r600_bytecode_add_alu_type()
1495 LIST_ADDTAIL(&nalu->list, &bc->cf_last->alu); in r600_bytecode_add_alu_type()
1552 int r600_bytecode_add_alu(struct r600_bytecode *bc, const struct r600_bytecode_alu *alu) in r600_bytecode_add_alu() argument
1554 return r600_bytecode_add_alu_type(bc, alu, BC_INST(bc, V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU)); in r600_bytecode_add_alu()
1765 static int r600_bytecode_alu_build(struct r600_bytecode *bc, struct r600_bytecode_alu *alu, unsigne… in r600_bytecode_alu_build() argument
1768 bc->bytecode[id++] = S_SQ_ALU_WORD0_SRC0_SEL(alu->src[0].sel) | in r600_bytecode_alu_build()
1769 S_SQ_ALU_WORD0_SRC0_REL(alu->src[0].rel) | in r600_bytecode_alu_build()
1770 S_SQ_ALU_WORD0_SRC0_CHAN(alu->src[0].chan) | in r600_bytecode_alu_build()
1771 S_SQ_ALU_WORD0_SRC0_NEG(alu->src[0].neg) | in r600_bytecode_alu_build()
1772 S_SQ_ALU_WORD0_SRC1_SEL(alu->src[1].sel) | in r600_bytecode_alu_build()
1773 S_SQ_ALU_WORD0_SRC1_REL(alu->src[1].rel) | in r600_bytecode_alu_build()
1774 S_SQ_ALU_WORD0_SRC1_CHAN(alu->src[1].chan) | in r600_bytecode_alu_build()
1775 S_SQ_ALU_WORD0_SRC1_NEG(alu->src[1].neg) | in r600_bytecode_alu_build()
1776 S_SQ_ALU_WORD0_INDEX_MODE(alu->index_mode) | in r600_bytecode_alu_build()
1777 S_SQ_ALU_WORD0_PRED_SEL(alu->pred_sel) | in r600_bytecode_alu_build()
1778 S_SQ_ALU_WORD0_LAST(alu->last); in r600_bytecode_alu_build()
1780 if (alu->is_op3) { in r600_bytecode_alu_build()
1781 bc->bytecode[id++] = S_SQ_ALU_WORD1_DST_GPR(alu->dst.sel) | in r600_bytecode_alu_build()
1782 S_SQ_ALU_WORD1_DST_CHAN(alu->dst.chan) | in r600_bytecode_alu_build()
1783 S_SQ_ALU_WORD1_DST_REL(alu->dst.rel) | in r600_bytecode_alu_build()
1784 S_SQ_ALU_WORD1_CLAMP(alu->dst.clamp) | in r600_bytecode_alu_build()
1785 S_SQ_ALU_WORD1_OP3_SRC2_SEL(alu->src[2].sel) | in r600_bytecode_alu_build()
1786 S_SQ_ALU_WORD1_OP3_SRC2_REL(alu->src[2].rel) | in r600_bytecode_alu_build()
1787 S_SQ_ALU_WORD1_OP3_SRC2_CHAN(alu->src[2].chan) | in r600_bytecode_alu_build()
1788 S_SQ_ALU_WORD1_OP3_SRC2_NEG(alu->src[2].neg) | in r600_bytecode_alu_build()
1789 S_SQ_ALU_WORD1_OP3_ALU_INST(alu->inst) | in r600_bytecode_alu_build()
1790 S_SQ_ALU_WORD1_BANK_SWIZZLE(alu->bank_swizzle); in r600_bytecode_alu_build()
1792 bc->bytecode[id++] = S_SQ_ALU_WORD1_DST_GPR(alu->dst.sel) | in r600_bytecode_alu_build()
1793 S_SQ_ALU_WORD1_DST_CHAN(alu->dst.chan) | in r600_bytecode_alu_build()
1794 S_SQ_ALU_WORD1_DST_REL(alu->dst.rel) | in r600_bytecode_alu_build()
1795 S_SQ_ALU_WORD1_CLAMP(alu->dst.clamp) | in r600_bytecode_alu_build()
1796 S_SQ_ALU_WORD1_OP2_SRC0_ABS(alu->src[0].abs) | in r600_bytecode_alu_build()
1797 S_SQ_ALU_WORD1_OP2_SRC1_ABS(alu->src[1].abs) | in r600_bytecode_alu_build()
1798 S_SQ_ALU_WORD1_OP2_WRITE_MASK(alu->dst.write) | in r600_bytecode_alu_build()
1799 S_SQ_ALU_WORD1_OP2_OMOD(alu->omod) | in r600_bytecode_alu_build()
1800 S_SQ_ALU_WORD1_OP2_ALU_INST(alu->inst) | in r600_bytecode_alu_build()
1801 S_SQ_ALU_WORD1_BANK_SWIZZLE(alu->bank_swizzle) | in r600_bytecode_alu_build()
1802 S_SQ_ALU_WORD1_OP2_UPDATE_EXECUTE_MASK(alu->execute_mask) | in r600_bytecode_alu_build()
1803 S_SQ_ALU_WORD1_OP2_UPDATE_PRED(alu->update_pred); in r600_bytecode_alu_build()
1904 struct r600_bytecode_alu *alu; in r600_bytecode_build() local
2025 LIST_FOR_EACH_ENTRY(alu, &cf->alu, list) { in r600_bytecode_build()
2026 r = r600_bytecode_alu_nliterals(bc, alu, literal, &nliteral); in r600_bytecode_build()
2029 r600_bytecode_alu_adjust_literals(bc, alu, literal, nliteral); in r600_bytecode_build()
2030 r600_bytecode_assign_kcache_banks(bc, alu, cf->kcache); in r600_bytecode_build()
2035 r = r700_bytecode_alu_build(bc, alu, addr); in r600_bytecode_build()
2044 if (alu->last) { in r600_bytecode_build()
2124 LIST_FOR_EACH_ENTRY(alu, &cf->alu, list) { in r600_bytecode_build()
2125 r = r600_bytecode_alu_nliterals(bc, alu, literal, &nliteral); in r600_bytecode_build()
2128 r600_bytecode_alu_adjust_literals(bc, alu, literal, nliteral); in r600_bytecode_build()
2129 r600_bytecode_assign_kcache_banks(bc, alu, cf->kcache); in r600_bytecode_build()
2133 r = r600_bytecode_alu_build(bc, alu, addr); in r600_bytecode_build()
2136 r = r700_bytecode_alu_build(bc, alu, addr); in r600_bytecode_build()
2145 if (alu->last) { in r600_bytecode_build()
2205 struct r600_bytecode_alu *alu = NULL, *next_alu; in r600_bytecode_clear() local
2209 LIST_FOR_EACH_ENTRY_SAFE(alu, next_alu, &cf->alu, list) { in r600_bytecode_clear()
2210 free(alu); in r600_bytecode_clear()
2213 LIST_INITHEAD(&cf->alu); in r600_bytecode_clear()
2236 struct r600_bytecode_alu *alu = NULL; in r600_bytecode_dump() local
2483 LIST_FOR_EACH_ENTRY(alu, &cf->alu, list) { in r600_bytecode_dump()
2484 r600_bytecode_alu_nliterals(bc, alu, literal, &nliteral); in r600_bytecode_dump()
2487 fprintf(stderr, "SRC0(SEL:%d ", alu->src[0].sel); in r600_bytecode_dump()
2488 fprintf(stderr, "REL:%d ", alu->src[0].rel); in r600_bytecode_dump()
2489 fprintf(stderr, "CHAN:%d ", alu->src[0].chan); in r600_bytecode_dump()
2490 fprintf(stderr, "NEG:%d) ", alu->src[0].neg); in r600_bytecode_dump()
2491 fprintf(stderr, "SRC1(SEL:%d ", alu->src[1].sel); in r600_bytecode_dump()
2492 fprintf(stderr, "REL:%d ", alu->src[1].rel); in r600_bytecode_dump()
2493 fprintf(stderr, "CHAN:%d ", alu->src[1].chan); in r600_bytecode_dump()
2494 fprintf(stderr, "NEG:%d ", alu->src[1].neg); in r600_bytecode_dump()
2495 fprintf(stderr, "IM:%d) ", alu->index_mode); in r600_bytecode_dump()
2496 fprintf(stderr, "PRED_SEL:%d ", alu->pred_sel); in r600_bytecode_dump()
2497 fprintf(stderr, "LAST:%d)\n", alu->last); in r600_bytecode_dump()
2499 fprintf(stderr, "%04d %08X %c ", id, bc->bytecode[id], alu->last ? '*' : ' '); in r600_bytecode_dump()
2500 fprintf(stderr, "INST:0x%x ", alu->inst); in r600_bytecode_dump()
2501 fprintf(stderr, "DST(SEL:%d ", alu->dst.sel); in r600_bytecode_dump()
2502 fprintf(stderr, "CHAN:%d ", alu->dst.chan); in r600_bytecode_dump()
2503 fprintf(stderr, "REL:%d ", alu->dst.rel); in r600_bytecode_dump()
2504 fprintf(stderr, "CLAMP:%d) ", alu->dst.clamp); in r600_bytecode_dump()
2505 fprintf(stderr, "BANK_SWIZZLE:%d ", alu->bank_swizzle); in r600_bytecode_dump()
2506 if (alu->is_op3) { in r600_bytecode_dump()
2507 fprintf(stderr, "SRC2(SEL:%d ", alu->src[2].sel); in r600_bytecode_dump()
2508 fprintf(stderr, "REL:%d ", alu->src[2].rel); in r600_bytecode_dump()
2509 fprintf(stderr, "CHAN:%d ", alu->src[2].chan); in r600_bytecode_dump()
2510 fprintf(stderr, "NEG:%d)\n", alu->src[2].neg); in r600_bytecode_dump()
2512 fprintf(stderr, "SRC0_ABS:%d ", alu->src[0].abs); in r600_bytecode_dump()
2513 fprintf(stderr, "SRC1_ABS:%d ", alu->src[1].abs); in r600_bytecode_dump()
2514 fprintf(stderr, "WRITE_MASK:%d ", alu->dst.write); in r600_bytecode_dump()
2515 fprintf(stderr, "OMOD:%d ", alu->omod); in r600_bytecode_dump()
2516 fprintf(stderr, "EXECUTE_MASK:%d ", alu->execute_mask); in r600_bytecode_dump()
2517 fprintf(stderr, "UPDATE_PRED:%d\n", alu->update_pred); in r600_bytecode_dump()
2521 if (alu->last) { in r600_bytecode_dump()
2770 struct r600_bytecode_alu alu; in r600_vertex_elements_build_fetch_shader() local
2771 memset(&alu, 0, sizeof(alu)); in r600_vertex_elements_build_fetch_shader()
2772 alu.inst = BC_INST(&bc, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MULHI_UINT); in r600_vertex_elements_build_fetch_shader()
2773 alu.src[0].sel = 0; in r600_vertex_elements_build_fetch_shader()
2774 alu.src[0].chan = 3; in r600_vertex_elements_build_fetch_shader()
2775 alu.src[1].sel = V_SQ_ALU_SRC_LITERAL; in r600_vertex_elements_build_fetch_shader()
2776 alu.src[1].value = (1ll << 32) / elements[i].instance_divisor + 1; in r600_vertex_elements_build_fetch_shader()
2777 alu.dst.sel = i + 1; in r600_vertex_elements_build_fetch_shader()
2778 alu.dst.chan = j; in r600_vertex_elements_build_fetch_shader()
2779 alu.dst.write = j == 3; in r600_vertex_elements_build_fetch_shader()
2780 alu.last = j == 3; in r600_vertex_elements_build_fetch_shader()
2781 if ((r = r600_bytecode_add_alu(&bc, &alu))) { in r600_vertex_elements_build_fetch_shader()
2787 struct r600_bytecode_alu alu; in r600_vertex_elements_build_fetch_shader() local
2788 memset(&alu, 0, sizeof(alu)); in r600_vertex_elements_build_fetch_shader()
2789 alu.inst = BC_INST(&bc, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MULHI_UINT); in r600_vertex_elements_build_fetch_shader()
2790 alu.src[0].sel = 0; in r600_vertex_elements_build_fetch_shader()
2791 alu.src[0].chan = 3; in r600_vertex_elements_build_fetch_shader()
2792 alu.src[1].sel = V_SQ_ALU_SRC_LITERAL; in r600_vertex_elements_build_fetch_shader()
2793 alu.src[1].value = (1ll << 32) / elements[i].instance_divisor + 1; in r600_vertex_elements_build_fetch_shader()
2794 alu.dst.sel = i + 1; in r600_vertex_elements_build_fetch_shader()
2795 alu.dst.chan = 3; in r600_vertex_elements_build_fetch_shader()
2796 alu.dst.write = 1; in r600_vertex_elements_build_fetch_shader()
2797 alu.last = 1; in r600_vertex_elements_build_fetch_shader()
2798 if ((r = r600_bytecode_add_alu(&bc, &alu))) { in r600_vertex_elements_build_fetch_shader()