Lines Matching defs:tuple

50 /* State of a single tuple and clause under construction */
58 * "forced" for the next scheduled tuple, provided such a tuple
63 /* The previous tuple scheduled (= the next tuple executed in the
72 /* Is this the last tuple in the clause */
78 /* Reads for previous (succeeding) tuple */
83 /* Register slot state for current tuple */
86 /* Constants are shared in the tuple. If constant_count is nonzero, it
89 * but within a tuple, that should be encoded as constant_count != 0
308 struct bi_clause_state *clause, struct bi_tuple_state *tuple)
310 bi_instr *pinstr = tuple->add;
331 bi_tuple_state *tuple)
333 bi_instr *pinstr = tuple->add;
350 bi_tuple_state *tuple)
352 bi_instr *pinstr = tuple->add;
371 struct bi_clause_state *clause, struct bi_tuple_state *tuple)
373 bi_instr *pinstr = tuple->add;
391 struct bi_clause_state *clause, struct bi_tuple_state *tuple)
393 bi_instr *add = tuple->add;
736 /* Would there be space for constants if we added one tuple? */
744 /* Updates the FAU assignment for a tuple. A valid FAU assignment must be
746 * this is gauranteed per-instruction by bi_lower_fau and per-tuple by
751 struct bi_tuple_state *tuple,
756 unsigned *constant_count = &tuple->constant_count;
757 uint32_t *constants = tuple->constants;
758 enum bir_fau fau = tuple->fau;
761 memcpy(copied_constants, tuple->constants,
763 copied_count = tuple->constant_count;
779 tuple->fau = src.value;
797 (i != tuple->pcrel_idx);
811 tuple->pcrel_idx = *constant_count;
819 /* Constants per clause may be limited by tuple count */
831 /* Given an in-progress tuple, a candidate new instruction to add to the tuple,
851 /* If a source is already read in the tuple, it is already counted */
924 /* Likewise for cross-tuple passthrough (reads_temps) */
944 * for a write that will be discarded after one tuple. */
979 struct bi_tuple_state *tuple,
992 if (bi_opcode_props[instr->op].last && !tuple->last)
995 if (bi_must_not_last(instr) && tuple->last)
1032 if (!bi_update_fau(clause, tuple, instr, fma, false))
1037 if (tuple->add && bi_has_staging_passthrough_hazard(instr->dest[0], tuple->add))
1040 /* If this choice of destination would force a cross-tuple passthrough, the next tuple must support that */
1041 if (tuple->prev && bi_has_cross_passthrough_hazard(tuple->prev, instr))
1045 unsigned total_writes = tuple->reg.nr_writes;
1048 /* Last tuple in a clause can only write a single value */
1049 if (tuple->last && total_writes > 1)
1057 if (bi_tuple_is_new_src(instr, &tuple->reg, s))
1061 unsigned total_srcs = tuple->reg.nr_reads + unique_new_srcs;
1063 bool can_spill_to_moves = (!tuple->add);
1073 tuple->add ? tuple->add->dest[0] : bi_null(),
1074 tuple->prev_reads, tuple->nr_prev_reads);
1084 bi_instr_cost(bi_instr *instr, struct bi_tuple_state *tuple)
1110 struct bi_tuple_state *tuple,
1120 if (!bi_instr_schedulable(instr, clause, tuple, live_after_temp, fma))
1123 signed cost = bi_instr_cost(instr, tuple);
1140 bi_pop_instr(struct bi_clause_state *clause, struct bi_tuple_state *tuple,
1143 bi_update_fau(clause, tuple, instr, fma, true);
1151 tuple->reg.nr_writes += bi_write_count(instr, live_after_temp);
1154 if (bi_tuple_is_new_src(instr, &tuple->reg, s))
1155 tuple->reg.reads[tuple->reg.nr_reads++] = instr->src[s];
1165 struct bi_tuple_state *tuple,
1169 if (tuple->add && tuple->add->op == BI_OPCODE_CUBEFACE)
1170 return bi_lower_cubeface(ctx, clause, tuple);
1171 else if (tuple->add && tuple->add->op == BI_OPCODE_PATOM_C_I32)
1172 return bi_lower_atom_c(ctx, clause, tuple);
1173 else if (tuple->add && tuple->add->op == BI_OPCODE_PATOM_C1_I32)
1174 return bi_lower_atom_c1(ctx, clause, tuple);
1175 else if (tuple->add && tuple->add->op == BI_OPCODE_SEG_ADD_I64)
1176 return bi_lower_seg_add(ctx, clause, tuple);
1177 else if (tuple->add && tuple->add->table)
1178 return bi_lower_dtsel(ctx, clause, tuple);
1181 if (!fma && tuple->nr_prev_reads > 3) {
1183 assert(tuple->nr_prev_reads == 4);
1186 bi_index src = tuple->prev_reads[0];
1189 bi_builder b = bi_init_builder(ctx, bi_before_tuple(tuple->prev));
1191 bi_pop_instr(clause, tuple, mov, live_after_temp, fma);
1197 if ((bifrost_debug & BIFROST_DBG_NOSCHED) && tuple->add)
1201 unsigned idx = bi_choose_index(st, clause, tuple, live_after_temp, fma);
1211 bi_pop_instr(clause, tuple, instr, live_after_temp, fma);
1254 * write to the same logical register, the next executed tuple will get the
1275 bi_rewrite_fau_to_pass(bi_tuple *tuple)
1277 bi_foreach_instr_and_src_in_tuple(tuple, ins, s) {
1303 bi_rewrite_constants_to_pass(bi_tuple *tuple, uint64_t constant, bool pcrel)
1305 bi_foreach_instr_and_src_in_tuple(tuple, ins, s) {
1333 /* Constructs a constant state given a tuple state. This has the
1339 bi_get_const_state(struct bi_tuple_state *tuple)
1342 .constant_count = tuple->constant_count,
1343 .constants[0] = tuple->constants[0],
1344 .constants[1] = tuple->constants[1],
1345 .pcrel = tuple->add && tuple->add->branch_target,
1363 * more than one tuple has pcrel:
1365 * 1. If a tuple has two constants, they must be packed together. If one is
1369 * 4. If a tuple has one constant, it may be shared with an existing
1371 * (distinct) tuple of a single constant.
1375 * tuple count 5/8 in EC0.
1525 /* Clauses with these tuple counts lack an M field for the packed EC0,
1592 bi_tuple *tuple = NULL;
1607 * the next tuple in the program. If you scheduled forwards, you'd need
1609 * delay updates to the live_after_temp by an extra tuple. */
1618 .prev = tuple,
1627 tuple = &clause->tuples[idx];
1636 tuple->fma = bi_take_instr(ctx, st, &clause_state, &tuple_state, live_after_temp, true);
1637 tuple->add = tuple_state.add;
1640 if (tuple->add)
1641 *live = bi_postra_liveness_ins(*live, tuple->add);
1643 if (tuple->fma)
1644 *live = bi_postra_liveness_ins(*live, tuple->fma);
1646 /* Rotate in the new per-tuple liveness */
1651 if (tuple->add && bi_must_message(tuple->add)) {
1656 bi_message_type_for_instr(tuple->add);
1657 clause->message = tuple->add;
1663 switch (tuple->add->op) {
1686 if (tuple->fma && bi_reads_zero(tuple->fma))
1687 bi_rewrite_zero(tuple->fma, true);
1691 tuple->fau_idx = tuple_state.fau;
1692 bi_rewrite_fau_to_pass(tuple);
1700 if (tuple->fma) {
1701 bi_use_passthrough(tuple->add, tuple->fma->dest[0],
1705 /* Don't add an empty tuple, unless the worklist has nothing
1715 if (!(tuple->fma || tuple->add || insert_empty))
1720 /* Adding enough tuple might overflow constants */
1725 /* Don't schedule more than 1 tuple if debugging */
1743 bi_tuple *tuple = &clause->tuples[i];
1749 bi_foreach_instr_in_tuple(tuple, ins)
1756 assert(tuple->fau_idx == BIR_FAU_ZERO);
1771 bi_tuple *tuple = &clause->tuples[i];
1778 assert(!tuple->fau_idx);
1788 tuple->fau_idx = bi_constant_field(word_idx) | lo;
1789 bi_rewrite_constants_to_pass(tuple, pair, word_idx == pcrel_idx);
1809 /* Use passthrough register for cross-tuple accesses. Note this is
1810 * after the memmove, so this is forwards. Skip the first tuple since