Lines Matching refs:ins

143 bi_message_type_for_instr(bi_instr *ins)
145 enum bifrost_message_type msg = bi_opcode_props[ins->op].message;
146 bool ld_var_special = (ins->op == BI_OPCODE_LD_VAR_SPECIAL);
148 if (ld_var_special && ins->varying_name == BI_VARYING_NAME_FRAG_Z)
151 if (msg == BIFROST_MESSAGE_LOAD && ins->seg == BI_SEG_UBO)
161 bi_supports_dtsel(bi_instr *ins)
163 switch (bi_message_type_for_instr(ins)) {
165 return ins->op != BI_OPCODE_LD_GCLK_U64;
235 bi_instr *ins = st.instructions[i];
237 bi_foreach_src(ins, s) {
238 if (ins->src[s].type != BI_INDEX_REGISTER) continue;
239 unsigned count = bi_count_read_registers(ins, s);
242 add_dependency(last_write, ins->src[s].value + c, i, st.dependents, st.dep_counts);
249 if (bi_message_type_for_instr(ins)) {
257 if (inorder || bi_is_sched_barrier(ins)) {
266 bi_foreach_dest(ins, d) {
267 if (ins->dest[d].type != BI_INDEX_REGISTER) continue;
268 unsigned dest = ins->dest[d].value;
270 unsigned count = bi_count_write_registers(ins, d);
282 if (ins->op == BI_OPCODE_BLEND && !is_blend) {
290 bi_foreach_src(ins, s) {
291 if (ins->src[s].type != BI_INDEX_REGISTER) continue;
293 unsigned count = bi_count_read_registers(ins, s);
296 mark_access(last_read, ins->src[s].value + c, i);
431 bi_foreach_instr_in_block(block, ins)
432 instructions[i++] = ins;
500 bi_can_iaddc(bi_instr *ins)
502 return (ins->op == BI_OPCODE_IADD_U32 && !ins->saturate &&
503 ins->src[0].swizzle == BI_SWIZZLE_H01 &&
504 ins->src[1].swizzle == BI_SWIZZLE_H01);
520 bi_can_fma(bi_instr *ins)
523 if (bi_can_iaddc(ins))
527 if (bi_can_replace_with_csel(ins))
531 if (ins->op == BI_OPCODE_FADD_V2F16 && bi_impacted_abs(ins))
535 return bi_opcode_props[ins->op].fma;
550 bi_can_add(bi_instr *ins)
553 if (ins->op == BI_OPCODE_FADD_V2F16 && ins->clamp)
557 if (ins->op == BI_OPCODE_FCMP_V2F16 && (ins->src[0].abs || ins->src[1].abs))
561 if (ins->op == BI_OPCODE_FADD_F32 && bi_impacted_fadd_widens(ins))
565 return bi_opcode_props[ins->op].add;
579 bi_must_not_last(bi_instr *ins)
581 return !bi_is_null(ins->dest[0]) && !bi_is_null(ins->dest[1]) &&
582 (ins->op != BI_OPCODE_TEXC);
592 bi_must_message(bi_instr *ins)
594 return (bi_opcode_props[ins->op].message != BIFROST_MESSAGE_NONE) ||
595 (ins->op == BI_OPCODE_DISCARD_F32);
620 bi_reads_zero(bi_instr *ins)
622 return !(bi_fma_atomic(ins->op) || ins->op == BI_OPCODE_IMULD);
626 bi_reads_temps(bi_instr *ins, unsigned src)
628 switch (ins->op) {
716 bi_reads_t(bi_instr *ins, unsigned src)
719 if (bi_opcode_props[ins->op].branch)
723 if (bi_opcode_props[ins->op].table)
728 if (bi_is_staging_src(ins, src))
733 if (bi_impacted_t_modifiers(ins, src))
737 switch (ins->op) {
753 return bi_reads_temps(ins, src);
963 bi_has_cross_passthrough_hazard(bi_tuple *succ, bi_instr *ins)
967 if (bi_is_word_equiv(ins->dest[0], pins->src[s]) &&
1305 bi_use_passthrough(bi_instr *ins, bi_index old,
1310 if (!ins || bi_is_null(old))
1313 bi_foreach_src(ins, i) {
1317 if (bi_is_word_equiv(ins->src[i], old)) {
1318 ins->src[i].type = BI_INDEX_PASS;
1319 ins->src[i].value = new;
1320 ins->src[i].reg = false;
1321 ins->src[i].offset = 0;
1353 bi_foreach_instr_and_src_in_tuple(tuple, ins, s) {
1354 if (ins->src[s].type != BI_INDEX_FAU) continue;
1356 bi_index pass = bi_passthrough(ins->src[s].offset ?
1359 ins->src[s] = bi_replace_index(ins->src[s], pass);
1364 bi_rewrite_zero(bi_instr *ins, bool fma)
1368 bi_foreach_src(ins, s) {
1369 bi_index src = ins->src[s];
1372 ins->src[s] = bi_replace_index(src, zero);
1381 bi_foreach_instr_and_src_in_tuple(tuple, ins, s) {
1382 if (ins->src[s].type != BI_INDEX_CONSTANT) continue;
1384 uint32_t cons = ins->src[s].value;
1393 if (cons == 0 && ins->branch_target != NULL) {
1403 ins->src[s] = bi_replace_index(ins->src[s],
1825 bi_foreach_instr_in_tuple(tuple, ins)
1826 bi_rewrite_zero(ins, false);
1928 bi_foreach_instr_in_block_safe(block, ins) {
1929 list_del(&ins->link);
1934 bi_foreach_instr_in_tuple(&clause->tuples[i], ins) {
1935 list_addtail(&ins->link, &block->instructions);
1959 bi_check_fau_src(bi_instr *ins, unsigned s, uint32_t *constants, unsigned *cwords, bi_index *fau)
1961 bi_index src = ins->src[s];
1964 if (bi_is_staging_src(ins, s))
1969 if (src.value == 0 && bi_opcode_props[ins->op].fma && bi_reads_zero(ins))
1994 if (ins->branch_target)
2006 bi_foreach_instr_global_safe(ctx, ins) {
2007 bi_builder b = bi_init_builder(ctx, bi_before_instr(ins));
2015 if (ins->op == BI_OPCODE_ATEST)
2016 fau = ins->src[2];
2021 if (ins->op == BI_OPCODE_TEXC) {
2022 assert(ins->src[3].type == BI_INDEX_CONSTANT);
2023 constants[cwords++] = ins->src[3].value;
2026 bi_foreach_src(ins, s) {
2027 if (bi_check_fau_src(ins, s, constants, &cwords, &fau)) continue;
2029 bi_index copy = bi_mov_i32(&b, ins->src[s]);
2030 ins->src[s] = bi_replace_index(ins->src[s], copy);