• Home
  • History
  • Annotate
  • Raw
  • Download

Lines Matching refs:instr

29 static bool scalar_possible(struct ir2_instr *instr)  in scalar_possible()  argument
31 if (instr->alu.scalar_opc == SCALAR_NONE) in scalar_possible()
34 return src_ncomp(instr) == 1; in scalar_possible()
56 static unsigned alu_vector_prio(struct ir2_instr *instr) in alu_vector_prio() argument
58 if (instr->alu.vector_opc == VECTOR_NONE) in alu_vector_prio()
61 if (is_export(instr)) in alu_vector_prio()
65 if (instr->src_count == 3) in alu_vector_prio()
68 if (!scalar_possible(instr)) in alu_vector_prio()
71 return instr->src_count == 2 ? 2 : 3; in alu_vector_prio()
75 static unsigned alu_scalar_prio(struct ir2_instr *instr) in alu_scalar_prio() argument
77 if (!scalar_possible(instr)) in alu_scalar_prio()
81 if (instr->src_count > 1) in alu_scalar_prio()
84 if (is_export(instr)) in alu_scalar_prio()
88 if (instr->alu.scalar_opc >= PRED_SETEs && in alu_scalar_prio()
89 instr->alu.scalar_opc <= PRED_SET_RESTOREs) in alu_scalar_prio()
93 return instr->alu.vector_opc == VECTOR_NONE ? 0 : 3; in alu_scalar_prio()
111 if (s->instr && s->instr->block_idx != block_idx) in insert()
117 if ((s->instr && s->instr->idx == src1.num) || in insert()
127 if (s->instr_s || s->instr->src_count == 3) in insert()
130 if (s->instr->type != IR2_ALU || s->instr->alu.export >= 0) in insert()
153 scalarize_case1(struct ir2_context *ctx, struct ir2_instr *instr, bool order) in scalarize_case1() argument
155 struct ir2_src src0 = instr->src[ order]; in scalarize_case1()
156 struct ir2_src src1 = instr->src[!order]; in scalarize_case1()
182 if (reg->comp[i].ref_count != !!(instr->alu.write_mask & 1 << i)) in scalarize_case1()
186 sched = insert(ctx, instr->block_idx, reg->idx, src1, &comp); in scalarize_case1()
190 ins = &ctx->instr[idx = ctx->instr_count++]; in scalarize_case1()
202 ins->pred = instr->pred; in scalarize_case1()
203 ins->block_idx = instr->block_idx; in scalarize_case1()
205 instr->src[0] = src0; in scalarize_case1()
206 instr->alu.src1_swizzle = comp; in scalarize_case1()
222 ir2_foreach_instr(instr, ctx) { in sched_next()
223 if (!instr->need_emit) in sched_next()
225 if (is_export(instr)) in sched_next()
226 export = MIN2(export, export_buf(instr->alu.export)); in sched_next()
229 ir2_foreach_instr(instr, ctx) { in sched_next()
230 if (!instr->need_emit) in sched_next()
234 if (is_export(instr) && export_buf(instr->alu.export) != export) in sched_next()
238 block_idx = instr->block_idx; in sched_next()
239 else if (block_idx != instr->block_idx || /* must be same block */ in sched_next()
240 instr->type == IR2_CF || /* CF/MEM must be alone */ in sched_next()
241 (is_export(instr) && export == SQ_MEMORY)) in sched_next()
250 ir2_foreach_src(src, instr) { in sched_next()
259 if (!p->is_ssa && p->reg == reg && p->idx < instr->idx) in sched_next()
264 is_ok &= !ctx->instr[src->num].need_emit; in sched_next()
268 if (!instr->is_ssa) { in sched_next()
270 if (!p->need_emit || p->idx >= instr->idx) in sched_next()
274 if (get_reg_src(ctx, src) == instr->reg) in sched_next()
280 if (avail_count && instr->pred != avail[0]->pred) in sched_next()
286 avail[avail_count++] = instr; in sched_next()
295 ir2_foreach_avail(instr) { in sched_next()
296 if (instr->type == IR2_ALU) in sched_next()
299 ra_src_free(ctx, instr); in sched_next()
300 ra_reg(ctx, get_reg(instr), -1, false, 0); in sched_next()
302 instr->need_emit = false; in sched_next()
303 sched->instr = instr; in sched_next()
311 ir2_foreach_avail(instr) { in sched_next()
312 prio = alu_vector_prio(instr); in sched_next()
314 instr_v = instr; in sched_next()
321 ir2_foreach_avail(instr) { in sched_next()
322 bool compat = is_alu_compatible(instr_v, instr); in sched_next()
324 prio = alu_scalar_prio(instr); in sched_next()
329 instr_s = instr; in sched_next()
343 ir2_foreach_avail(instr) { in sched_next()
344 if (!is_alu_compatible(instr_v, instr) || !scalar_possible(instr)) in sched_next()
348 assert(instr->src_count == 2); in sched_next()
350 if (scalarize_case1(ctx, instr, 0)) { in sched_next()
351 instr_s = instr; in sched_next()
354 if (scalarize_case1(ctx, instr, 1)) { in sched_next()
355 instr_s = instr; in sched_next()
379 sched->instr = instr_v; in sched_next()
406 struct ir2_instr *instr = sched->instr, *tex_lod; in schedule_instrs() local
407 if (instr && instr->type == IR2_FETCH && in schedule_instrs()
408 instr->fetch.opc == TEX_FETCH && instr->src_count == 2) { in schedule_instrs()
410 tex_lod = &ctx->instr[ctx->instr_count++]; in schedule_instrs()
412 tex_lod->block_idx = instr->block_idx; in schedule_instrs()
413 tex_lod->pred = instr->pred; in schedule_instrs()
415 tex_lod->src[0] = instr->src[1]; in schedule_instrs()
419 sched->instr = tex_lod; in schedule_instrs()
424 ir2_foreach_instr(instr, ctx) in schedule_instrs()
425 free_block &= instr->block_idx != block_idx; in schedule_instrs()