Lines Matching defs:instr

788                 bi_instr *instr, bool fma, bool destructive)
805 bi_foreach_src(instr, s) {
806 bi_index src = instr->src[s];
823 if (src.value == 0 && fma && bi_reads_zero(instr))
828 bool pcrel = instr->branch_target && src.value == 0;
875 bi_tuple_is_new_src(bi_instr *instr, struct bi_reg_state *reg, unsigned src_idx)
877 bi_index src = instr->src[src_idx];
884 if (bi_is_staging_src(instr, src_idx))
894 if (bi_is_word_equiv(src, instr->src[t]))
983 bi_write_count(bi_instr *instr, uint64_t live_after_temp)
985 if (instr->op == BI_OPCODE_ATEST || instr->op == BI_OPCODE_BLEND)
990 bi_foreach_dest(instr, d) {
991 if (d == 0 && bi_opcode_props[instr->op].sr_write)
994 if (bi_is_null(instr->dest[d]))
997 assert(instr->dest[0].type == BI_INDEX_REGISTER);
998 if (live_after_temp & BITFIELD64_BIT(instr->dest[0].value))
1021 bi_numerically_incompatible(struct bi_clause_state *clause, bi_instr *instr)
1024 ((clause->ftz == BI_FTZ_STATE_ENABLE) != bi_needs_ftz(instr));
1035 bi_instr_schedulable(bi_instr *instr,
1042 if ((fma && !bi_can_fma(instr)) || (!fma && !bi_can_add(instr)))
1046 if (bi_must_message(instr) && clause->message)
1050 if (bi_opcode_props[instr->op].last && !tuple->last)
1053 if (bi_must_not_last(instr) && tuple->last)
1057 if (bi_numerically_incompatible(clause, instr))
1064 if (bi_opcode_props[instr->op].sr_write) {
1065 bi_foreach_dest(instr, d) {
1066 if (bi_is_null(instr->dest[d]))
1069 unsigned nr = bi_count_write_registers(instr, d);
1070 assert(instr->dest[d].type == BI_INDEX_REGISTER);
1071 unsigned reg = instr->dest[d].value;
1083 if (bi_opcode_props[instr->op].sr_read && !bi_is_null(instr->src[0])) {
1084 unsigned nr = bi_count_read_registers(instr, 0);
1085 assert(instr->src[0].type == BI_INDEX_REGISTER);
1086 unsigned reg = instr->src[0].value;
1099 if (!bi_update_fau(clause, tuple, instr, fma, false))
1104 if (tuple->add && bi_has_staging_passthrough_hazard(instr->dest[0], tuple->add))
1108 if (tuple->prev && bi_has_cross_passthrough_hazard(tuple->prev, instr))
1113 total_writes += bi_write_count(instr, live_after_temp);
1123 bi_foreach_src(instr, s) {
1124 if (bi_tuple_is_new_src(instr, &tuple->reg, s))
1139 unsigned succ_reads = bi_count_succ_reads(instr->dest[0],
1151 bi_instr_cost(bi_instr *instr, struct bi_tuple_state *tuple)
1157 if (bi_can_fma(instr) && bi_can_add(instr))
1164 if (bi_must_message(instr))
1168 if (bi_opcode_props[instr->op].last)
1185 bi_instr *instr = st.instructions[i];
1187 if (!bi_instr_schedulable(instr, clause, tuple, live_after_temp, fma))
1190 signed cost = bi_instr_cost(instr, tuple);
1208 bi_instr *instr, uint64_t live_after_temp, bool fma)
1210 bi_update_fau(clause, tuple, instr, fma, true);
1214 memcpy(clause->accesses + clause->access_count, instr->src, sizeof(instr->src));
1216 memcpy(clause->accesses + clause->access_count, instr->dest, sizeof(instr->dest));
1218 tuple->reg.nr_writes += bi_write_count(instr, live_after_temp);
1220 bi_foreach_src(instr, s) {
1221 if (bi_tuple_is_new_src(instr, &tuple->reg, s))
1222 tuple->reg.reads[tuple->reg.nr_reads++] = instr->src[s];
1229 clause->ftz = bi_needs_ftz(instr) ? BI_FTZ_STATE_ENABLE :
1281 bi_instr *instr = st.instructions[idx];
1285 bi_pop_instr(clause, tuple, instr, live_after_temp, fma);
1288 if (instr->op == BI_OPCODE_IADD_U32 && fma) {
1289 assert(bi_can_iaddc(instr));
1290 instr->op = BI_OPCODE_IADDC_I32;
1291 instr->src[2] = bi_zero();
1292 } else if (fma && bi_can_replace_with_csel(instr)) {
1293 bi_replace_mux_with_csel(instr, false);
1296 return instr;