• Home
  • Raw
  • Download

Lines Matching refs:instr

71 collect_reg_info(struct ir3_instruction *instr, struct ir3_register *reg,  in collect_reg_info()  argument
75 unsigned repeat = instr->repeat; in collect_reg_info()
235 foreach_instr (instr, &block->instr_list) { in ir3_collect_info()
252 foreach_instr (instr, &block->instr_list) { in ir3_collect_info()
254 foreach_src (reg, instr) { in ir3_collect_info()
255 collect_reg_info(instr, reg, info); in ir3_collect_info()
258 foreach_dst (reg, instr) { in ir3_collect_info()
260 collect_reg_info(instr, reg, info); in ir3_collect_info()
264 if ((instr->opc == OPC_STP || instr->opc == OPC_LDP)) { in ir3_collect_info()
265 unsigned components = instr->srcs[2]->uim_val; in ir3_collect_info()
266 if (components * type_size(instr->cat6.type) > 32) { in ir3_collect_info()
270 if (instr->opc == OPC_STP) in ir3_collect_info()
276 if ((instr->opc == OPC_BARY_F) && (instr->dsts[0]->flags & IR3_REG_EI)) in ir3_collect_info()
279 unsigned instrs_count = 1 + instr->repeat + instr->nop; in ir3_collect_info()
280 unsigned nops_count = instr->nop; in ir3_collect_info()
282 if (instr->opc == OPC_NOP) { in ir3_collect_info()
283 nops_count = 1 + instr->repeat; in ir3_collect_info()
286 info->instrs_per_cat[opc_cat(instr->opc)] += 1 + instr->repeat; in ir3_collect_info()
290 if (instr->opc == OPC_MOV) { in ir3_collect_info()
291 if (instr->cat1.src_type == instr->cat1.dst_type) { in ir3_collect_info()
292 info->mov_count += 1 + instr->repeat; in ir3_collect_info()
294 info->cov_count += 1 + instr->repeat; in ir3_collect_info()
301 if (instr->flags & IR3_INSTR_SS) { in ir3_collect_info()
307 if (instr->flags & IR3_INSTR_SY) in ir3_collect_info()
310 if (is_sfu(instr)) { in ir3_collect_info()
313 int n = MIN2(sfu_delay, 1 + instr->repeat + instr->nop); in ir3_collect_info()
346 insert_instr(struct ir3_block *block, struct ir3_instruction *instr) in insert_instr() argument
350 instr->serialno = ++shader->instr_count; in insert_instr()
352 list_addtail(&instr->node, &block->instr_list); in insert_instr()
354 if (is_input(instr)) in insert_instr()
355 array_insert(shader, shader->baryfs, instr); in insert_instr()
434 struct ir3_instruction *instr; in instr_create() local
435 unsigned sz = sizeof(*instr) + (ndst * sizeof(instr->dsts[0])) + in instr_create()
436 (nsrc * sizeof(instr->srcs[0])); in instr_create()
439 instr = (struct ir3_instruction *)ptr; in instr_create()
440 ptr += sizeof(*instr); in instr_create()
441 instr->dsts = (struct ir3_register **)ptr; in instr_create()
442 instr->srcs = instr->dsts + ndst; in instr_create()
445 instr->dsts_max = ndst; in instr_create()
446 instr->srcs_max = nsrc; in instr_create()
449 return instr; in instr_create()
455 struct ir3_instruction *instr = instr_create(block, opc, ndst, nsrc); in ir3_instr_create() local
456 instr->block = block; in ir3_instr_create()
457 instr->opc = opc; in ir3_instr_create()
458 insert_instr(block, instr); in ir3_instr_create()
459 return instr; in ir3_instr_create()
463 ir3_instr_clone(struct ir3_instruction *instr) in ir3_instr_clone() argument
466 instr->block, instr->opc, instr->dsts_count, instr->srcs_count); in ir3_instr_clone()
471 *new_instr = *instr; in ir3_instr_clone()
475 insert_instr(instr->block, new_instr); in ir3_instr_clone()
480 foreach_dst (reg, instr) { in ir3_instr_clone()
484 if (new_reg->instr) in ir3_instr_clone()
485 new_reg->instr = new_instr; in ir3_instr_clone()
487 foreach_src (reg, instr) { in ir3_instr_clone()
493 if (instr->address) { in ir3_instr_clone()
494 assert(instr->srcs_count > 0); in ir3_instr_clone()
495 new_instr->address = new_instr->srcs[instr->srcs_count - 1]; in ir3_instr_clone()
503 ir3_instr_add_dep(struct ir3_instruction *instr, struct ir3_instruction *dep) in ir3_instr_add_dep() argument
505 for (unsigned i = 0; i < instr->deps_count; i++) { in ir3_instr_add_dep()
506 if (instr->deps[i] == dep) in ir3_instr_add_dep()
510 array_insert(instr, instr->deps, dep); in ir3_instr_add_dep()
514 ir3_src_create(struct ir3_instruction *instr, int num, int flags) in ir3_src_create() argument
516 struct ir3 *shader = instr->block->shader; in ir3_src_create()
518 debug_assert(instr->srcs_count < instr->srcs_max); in ir3_src_create()
521 instr->srcs[instr->srcs_count++] = reg; in ir3_src_create()
526 ir3_dst_create(struct ir3_instruction *instr, int num, int flags) in ir3_dst_create() argument
528 struct ir3 *shader = instr->block->shader; in ir3_dst_create()
530 debug_assert(instr->dsts_count < instr->dsts_max); in ir3_dst_create()
533 instr->dsts[instr->dsts_count++] = reg; in ir3_dst_create()
546 ir3_reg_set_last_array(struct ir3_instruction *instr, struct ir3_register *reg, in ir3_reg_set_last_array() argument
550 struct ir3_register *new_reg = ir3_src_create(instr, 0, 0); in ir3_reg_set_last_array()
557 ir3_instr_set_address(struct ir3_instruction *instr, in ir3_instr_set_address() argument
560 if (!instr->address) { in ir3_instr_set_address()
561 struct ir3 *ir = instr->block->shader; in ir3_instr_set_address()
563 debug_assert(instr->block == addr->block); in ir3_instr_set_address()
565 instr->address = in ir3_instr_set_address()
566 ir3_src_create(instr, addr->dsts[0]->num, addr->dsts[0]->flags); in ir3_instr_set_address()
567 instr->address->def = addr->dsts[0]; in ir3_instr_set_address()
571 array_insert(ir, ir->a0_users, instr); in ir3_instr_set_address()
574 array_insert(ir, ir->a1_users, instr); in ir3_instr_set_address()
577 debug_assert(instr->address->def->instr == addr); in ir3_instr_set_address()
584 foreach_instr (instr, &block->instr_list) in ir3_block_clear_mark()
585 instr->flags &= ~IR3_INSTR_MARK; in ir3_block_clear_mark()
602 foreach_instr (instr, &block->instr_list) { in ir3_count_instructions()
603 instr->ip = cnt++; in ir3_count_instructions()
625 foreach_instr (instr, &block->instr_list) { in ir3_count_instructions_ra()
626 instr->ip = cnt++; in ir3_count_instructions_ra()
650 foreach_instr (instr, &block->instr_list) in ir3_find_ssa_uses()
651 instr->uses = NULL; in ir3_find_ssa_uses()
654 foreach_instr (instr, &block->instr_list) { in ir3_find_ssa_uses()
655 foreach_ssa_src_n (src, n, instr) { in ir3_find_ssa_uses()
656 if (__is_false_dep(instr, n) && !falsedeps) in ir3_find_ssa_uses()
660 _mesa_set_add(src->uses, instr); in ir3_find_ssa_uses()
672 ir3_set_dst_type(struct ir3_instruction *instr, bool half) in ir3_set_dst_type() argument
675 instr->dsts[0]->flags |= IR3_REG_HALF; in ir3_set_dst_type()
677 instr->dsts[0]->flags &= ~IR3_REG_HALF; in ir3_set_dst_type()
680 switch (opc_cat(instr->opc)) { in ir3_set_dst_type()
683 instr->cat1.dst_type = half_type(instr->cat1.dst_type); in ir3_set_dst_type()
685 instr->cat1.dst_type = full_type(instr->cat1.dst_type); in ir3_set_dst_type()
690 instr->opc = cat4_half_opc(instr->opc); in ir3_set_dst_type()
692 instr->opc = cat4_full_opc(instr->opc); in ir3_set_dst_type()
697 instr->cat5.type = half_type(instr->cat5.type); in ir3_set_dst_type()
699 instr->cat5.type = full_type(instr->cat5.type); in ir3_set_dst_type()
710 ir3_fixup_src_type(struct ir3_instruction *instr) in ir3_fixup_src_type() argument
712 switch (opc_cat(instr->opc)) { in ir3_fixup_src_type()
714 if (instr->srcs[0]->flags & IR3_REG_HALF) { in ir3_fixup_src_type()
715 instr->cat1.src_type = half_type(instr->cat1.src_type); in ir3_fixup_src_type()
717 instr->cat1.src_type = full_type(instr->cat1.src_type); in ir3_fixup_src_type()
721 if (instr->srcs[0]->flags & IR3_REG_HALF) { in ir3_fixup_src_type()
722 instr->opc = cat3_half_opc(instr->opc); in ir3_fixup_src_type()
724 instr->opc = cat3_full_opc(instr->opc); in ir3_fixup_src_type()
786 ir3_valid_flags(struct ir3_instruction *instr, unsigned n, unsigned flags) in ir3_valid_flags() argument
788 struct ir3_compiler *compiler = instr->block->shader->compiler; in ir3_valid_flags()
791 if ((flags & IR3_REG_SHARED) && opc_cat(instr->opc) > 3) in ir3_valid_flags()
799 if (instr->dsts_count > 0 && (instr->dsts[0]->flags & IR3_REG_RELATIV) && in ir3_valid_flags()
816 if (instr->srcs[n]->flags & IR3_REG_SSA) { in ir3_valid_flags()
817 struct ir3_instruction *src = ssa(instr->srcs[n]); in ir3_valid_flags()
818 if (src->address->def->instr->block != instr->block) in ir3_valid_flags()
823 if (is_meta(instr)) { in ir3_valid_flags()
830 if ((flags & IR3_REG_SHARED) && !(instr->dsts[0]->flags & IR3_REG_SHARED)) in ir3_valid_flags()
836 switch (opc_cat(instr->opc)) { in ir3_valid_flags()
840 switch (instr->opc) { in ir3_valid_flags()
855 valid_flags = ir3_cat2_absneg(instr->opc) | IR3_REG_CONST | in ir3_valid_flags()
866 if (m < instr->srcs_count) { in ir3_valid_flags()
867 struct ir3_register *reg = instr->srcs[m]; in ir3_valid_flags()
878 ir3_cat3_absneg(instr->opc) | IR3_REG_RELATIV | IR3_REG_SHARED; in ir3_valid_flags()
880 if (instr->opc == OPC_SHLG_B16) { in ir3_valid_flags()
925 if (is_store(instr) && (instr->opc != OPC_STG) && (n == 1)) in ir3_valid_flags()
928 if ((instr->opc == OPC_LDL) && (n == 0)) in ir3_valid_flags()
931 if ((instr->opc == OPC_STL) && (n != 2)) in ir3_valid_flags()
934 if ((instr->opc == OPC_LDP) && (n == 0)) in ir3_valid_flags()
937 if ((instr->opc == OPC_STP) && (n != 2)) in ir3_valid_flags()
940 if (instr->opc == OPC_STLW && n == 0) in ir3_valid_flags()
943 if (instr->opc == OPC_LDLW && n == 0) in ir3_valid_flags()
949 if (is_atomic(instr->opc) && (n != 0)) in ir3_valid_flags()
952 if (is_atomic(instr->opc) && !(instr->flags & IR3_INSTR_G)) in ir3_valid_flags()
955 if (instr->opc == OPC_STG && (n == 2)) in ir3_valid_flags()
958 if (instr->opc == OPC_STG_A && (n == 4)) in ir3_valid_flags()
964 switch (instr->opc) { in ir3_valid_flags()
983 ir3_valid_immediate(struct ir3_instruction *instr, int32_t immed) in ir3_valid_immediate() argument
985 if (instr->opc == OPC_MOV || is_meta(instr)) in ir3_valid_immediate()
988 if (is_mem(instr)) { in ir3_valid_immediate()
989 switch (instr->opc) { in ir3_valid_immediate()