• Home
  • Raw
  • Download

Lines Matching refs:ins

28 void mir_rewrite_index_src_single(midgard_instruction *ins, unsigned old, unsigned new)  in mir_rewrite_index_src_single()  argument
30 mir_foreach_src(ins, i) { in mir_rewrite_index_src_single()
31 if (ins->src[i] == old) in mir_rewrite_index_src_single()
32 ins->src[i] = new; in mir_rewrite_index_src_single()
36 void mir_rewrite_index_dst_single(midgard_instruction *ins, unsigned old, unsigned new) in mir_rewrite_index_dst_single() argument
38 if (ins->dest == old) in mir_rewrite_index_dst_single()
39 ins->dest = new; in mir_rewrite_index_dst_single()
43 mir_rewrite_index_src_single_swizzle(midgard_instruction *ins, unsigned old, unsigned new, unsigned… in mir_rewrite_index_src_single_swizzle() argument
45 for (unsigned i = 0; i < ARRAY_SIZE(ins->src); ++i) { in mir_rewrite_index_src_single_swizzle()
46 if (ins->src[i] != old) continue; in mir_rewrite_index_src_single_swizzle()
48 ins->src[i] = new; in mir_rewrite_index_src_single_swizzle()
49 mir_compose_swizzle(ins->swizzle[i], swizzle, ins->swizzle[i]); in mir_rewrite_index_src_single_swizzle()
56 mir_foreach_instr_global(ctx, ins) { in mir_rewrite_index_src()
57 mir_rewrite_index_src_single(ins, old, new); in mir_rewrite_index_src()
64 mir_foreach_instr_global(ctx, ins) { in mir_rewrite_index_src_swizzle()
65 mir_rewrite_index_src_single_swizzle(ins, old, new, swizzle); in mir_rewrite_index_src_swizzle()
72 mir_foreach_instr_global(ctx, ins) { in mir_rewrite_index_dst()
73 mir_rewrite_index_dst_single(ins, old, new); in mir_rewrite_index_dst()
96 mir_foreach_instr_global(ctx, ins) { in mir_use_count()
97 if (mir_has_arg(ins, value)) in mir_use_count()
124 mir_nontrivial_mod(midgard_instruction *ins, unsigned i, bool check_swizzle) in mir_nontrivial_mod() argument
126 bool is_int = midgard_is_integer_op(ins->op); in mir_nontrivial_mod()
129 if (ins->src_shift[i]) return true; in mir_nontrivial_mod()
131 if (ins->src_neg[i]) return true; in mir_nontrivial_mod()
132 if (ins->src_abs[i]) return true; in mir_nontrivial_mod()
135 if (ins->dest_type != ins->src_types[i]) return true; in mir_nontrivial_mod()
139 if (!(ins->mask & (1 << c))) continue; in mir_nontrivial_mod()
140 if (ins->swizzle[i][c] != c) return true; in mir_nontrivial_mod()
148 mir_nontrivial_outmod(midgard_instruction *ins) in mir_nontrivial_outmod() argument
150 bool is_int = midgard_is_integer_op(ins->op); in mir_nontrivial_outmod()
151 unsigned mod = ins->outmod; in mir_nontrivial_outmod()
153 if (ins->dest_type != ins->src_types[1]) in mir_nontrivial_outmod()
222 mir_bytemask(midgard_instruction *ins) in mir_bytemask() argument
224 unsigned type_size = nir_alu_type_get_type_size(ins->dest_type); in mir_bytemask()
225 return pan_to_bytemask(type_size, ins->mask); in mir_bytemask()
229 mir_set_bytemask(midgard_instruction *ins, uint16_t bytemask) in mir_set_bytemask() argument
231 unsigned type_size = nir_alu_type_get_type_size(ins->dest_type); in mir_set_bytemask()
232 ins->mask = mir_from_bytemask(bytemask, type_size); in mir_set_bytemask()
239 mir_upper_override(midgard_instruction *ins, unsigned inst_size) in mir_upper_override() argument
241 unsigned type_size = nir_alu_type_get_type_size(ins->dest_type); in mir_upper_override()
255 unsigned zeroes = __builtin_ctz(ins->mask); in mir_upper_override()
283 mir_bytemask_of_read_components_index(midgard_instruction *ins, unsigned i) in mir_bytemask_of_read_components_index() argument
286 if (ins->compact_branch && ins->branch.conditional && (i == 0)) in mir_bytemask_of_read_components_index()
295 if (ins->type == TAG_ALU_4 && !ins->compact_branch) { in mir_bytemask_of_read_components_index()
296 unsigned props = alu_opcode_props[ins->op].props; in mir_bytemask_of_read_components_index()
303 qmask = ins->mask; in mir_bytemask_of_read_components_index()
306 return mir_bytemask_of_read_components_single(ins->swizzle[i], qmask, in mir_bytemask_of_read_components_index()
307 nir_alu_type_get_type_size(ins->src_types[i])); in mir_bytemask_of_read_components_index()
311 mir_bytemask_of_read_components(midgard_instruction *ins, unsigned node) in mir_bytemask_of_read_components() argument
318 mir_foreach_src(ins, i) { in mir_bytemask_of_read_components()
319 if (ins->src[i] != node) continue; in mir_bytemask_of_read_components()
320 mask |= mir_bytemask_of_read_components_index(ins, i); in mir_bytemask_of_read_components()
334 mir_bundle_for_op(compiler_context *ctx, midgard_instruction ins) in mir_bundle_for_op() argument
336 midgard_instruction *u = mir_upload_ins(ctx, ins); in mir_bundle_for_op()
339 .tag = ins.type, in mir_bundle_for_op()
350 bundle.control = ins.type | u->unit; in mir_bundle_for_op()
380 midgard_instruction ins) in mir_insert_instruction_before_scheduled() argument
390 midgard_bundle new = mir_bundle_for_op(ctx, ins); in mir_insert_instruction_before_scheduled()
402 midgard_instruction ins) in mir_insert_instruction_after_scheduled() argument
416 midgard_bundle new = mir_bundle_for_op(ctx, ins); in mir_insert_instruction_after_scheduled()
426 mir_flip(midgard_instruction *ins) in mir_flip() argument
428 unsigned temp = ins->src[0]; in mir_flip()
429 ins->src[0] = ins->src[1]; in mir_flip()
430 ins->src[1] = temp; in mir_flip()
432 assert(ins->type == TAG_ALU_4); in mir_flip()
434 temp = ins->src_types[0]; in mir_flip()
435 ins->src_types[0] = ins->src_types[1]; in mir_flip()
436 ins->src_types[1] = temp; in mir_flip()
438 temp = ins->src_abs[0]; in mir_flip()
439 ins->src_abs[0] = ins->src_abs[1]; in mir_flip()
440 ins->src_abs[1] = temp; in mir_flip()
442 temp = ins->src_neg[0]; in mir_flip()
443 ins->src_neg[0] = ins->src_neg[1]; in mir_flip()
444 ins->src_neg[1] = temp; in mir_flip()
446 temp = ins->src_invert[0]; in mir_flip()
447 ins->src_invert[0] = ins->src_invert[1]; in mir_flip()
448 ins->src_invert[1] = temp; in mir_flip()
451 memcpy(temp_swizzle, ins->swizzle[0], sizeof(ins->swizzle[0])); in mir_flip()
452 memcpy(ins->swizzle[0], ins->swizzle[1], sizeof(ins->swizzle[0])); in mir_flip()
453 memcpy(ins->swizzle[1], temp_swizzle, sizeof(ins->swizzle[0])); in mir_flip()
466 mir_foreach_instr_global(ctx, ins) { in mir_compute_temp_count()
467 if (ins->dest < SSA_FIXED_MINIMUM) in mir_compute_temp_count()
468 max_dest = MAX2(max_dest, ins->dest + 1); in mir_compute_temp_count()