Lines Matching refs:clause

50 /* State of a single tuple and clause under construction */
72 /* Is this the last tuple in the clause */
106 /* Index of the constant into the clause */
133 /* Numerical state of the clause */
322 struct bi_clause_state *clause, struct bi_tuple_state *tuple)
344 bi_lower_atom_c(bi_context *ctx, struct bi_clause_state *clause, struct
363 bi_lower_atom_c1(bi_context *ctx, struct bi_clause_state *clause, struct
385 struct bi_clause_state *clause, struct bi_tuple_state *tuple)
405 struct bi_clause_state *clause, struct bi_tuple_state *tuple)
570 * paired instructions) can run afoul of the "no two writes on the last clause"
637 * requires workarounds in both RA and clause scheduling.
757 /* Counts the number of 64-bit constants required by a clause. TODO: We
762 bi_nconstants(struct bi_clause_state *clause)
766 for (unsigned i = 0; i < ARRAY_SIZE(clause->consts); ++i)
767 count_32 += clause->consts[i].constant_count;
775 bi_space_for_more_constants(struct bi_clause_state *clause)
777 return (bi_nconstants(clause) < 13 - (clause->tuple_count + 1));
786 bi_update_fau(struct bi_clause_state *clause,
855 /* Constants per clause may be limited by tuple count */
857 bi_space_for_more_constants(clause);
1017 * Test if an instruction would be numerically incompatible with the clause. At
1021 bi_numerically_incompatible(struct bi_clause_state *clause, bi_instr *instr)
1023 return (clause->ftz != BI_FTZ_STATE_NONE) &&
1024 ((clause->ftz == BI_FTZ_STATE_ENABLE) != bi_needs_ftz(instr));
1036 struct bi_clause_state *clause,
1045 /* There can only be one message-passing instruction per clause */
1046 if (bi_must_message(instr) && clause->message)
1056 /* Numerical properties must be compatible with the clause */
1057 if (bi_numerically_incompatible(clause, instr))
1061 * same clause (most likely they will not), so if a later instruction
1062 * in the clause accesses the destination, the message-passing
1073 for (unsigned i = 0; i < clause->access_count; ++i) {
1074 bi_index idx = clause->accesses[i];
1088 for (unsigned i = 0; i < clause->access_count; ++i) {
1089 bi_index idx = clause->accesses[i];
1099 if (!bi_update_fau(clause, tuple, instr, fma, false))
1115 /* Last tuple in a clause can only write a single value */
1131 can_spill_to_moves &= (bi_nconstants(clause) < 13 - (clause->tuple_count + 2));
1132 can_spill_to_moves &= (clause->tuple_count < 7);
1161 * later in the clause, so schedule them as late within a clause as
1176 struct bi_clause_state *clause,
1187 if (!bi_instr_schedulable(instr, clause, tuple, live_after_temp, fma))
1207 bi_pop_instr(struct bi_clause_state *clause, struct bi_tuple_state *tuple,
1210 bi_update_fau(clause, tuple, instr, fma, true);
1213 assert(clause->access_count + BI_MAX_SRCS + BI_MAX_DESTS <= ARRAY_SIZE(clause->accesses));
1214 memcpy(clause->accesses + clause->access_count, instr->src, sizeof(instr->src));
1215 clause->access_count += BI_MAX_SRCS;
1216 memcpy(clause->accesses + clause->access_count, instr->dest, sizeof(instr->dest));
1217 clause->access_count += BI_MAX_DESTS;
1229 clause->ftz = bi_needs_ftz(instr) ? BI_FTZ_STATE_ENABLE :
1238 struct bi_clause_state *clause,
1244 return bi_lower_cubeface(ctx, clause, tuple);
1246 return bi_lower_atom_c(ctx, clause, tuple);
1248 return bi_lower_atom_c1(ctx, clause, tuple);
1250 return bi_lower_seg_add(ctx, clause, tuple);
1252 return bi_lower_dtsel(ctx, clause, tuple);
1265 bi_pop_instr(clause, tuple, mov, live_after_temp, fma);
1275 unsigned idx = bi_choose_index(st, clause, tuple, live_after_temp, fma);
1285 bi_pop_instr(clause, tuple, instr, live_after_temp, fma);
1438 /* Merges constants in a clause, satisfying the following rules, assuming no
1573 * swapping all references so the meaning of the clause is preserved */
1612 * (with clause format 12), with M1 values computed from the pair */
1661 /* Schedule a single clause. If no instructions remain, return NULL. */
1667 bi_clause *clause = rzalloc(ctx, bi_clause);
1670 const unsigned max_tuples = ARRAY_SIZE(clause->tuples);
1673 clause->flow_control = BIFROST_FLOW_NBTB;
1675 /* The last clause can only write one instruction, so initialize that */
1691 .last = (clause->tuple_count == 0),
1701 unsigned idx = max_tuples - clause->tuple_count - 1;
1703 tuple = &clause->tuples[idx];
1705 if (clause->message && bi_opcode_props[clause->message->op].sr_read && !bi_is_null(clause->message->src[0])) {
1706 unsigned nr = bi_count_read_registers(clause->message, 0);
1707 live_after_temp |= (BITFIELD64_MASK(nr) << clause->message->src[0].value);
1726 /* We may have a message, but only one per clause */
1731 clause->message_type =
1733 clause->message = tuple->add;
1741 clause->dependencies |= (1 << BIFROST_SLOT_ELDEST_DEPTH);
1745 clause->dependencies |= (1 << BIFROST_SLOT_ELDEST_COLOUR);
1748 clause->dependencies |= (1 << BIFROST_SLOT_ELDEST_DEPTH);
1749 clause->dependencies |= (1 << BIFROST_SLOT_ELDEST_COLOUR);
1794 clause->tuple_count++;
1811 } while(clause->tuple_count < 8);
1813 /* Don't schedule an empty clause */
1814 if (!clause->tuple_count)
1818 for (unsigned i = max_tuples - clause->tuple_count; i < max_tuples; ++i) {
1819 bi_tuple *tuple = &clause->tuples[i];
1841 constant_pairs, &pcrel_idx, clause->tuple_count,
1844 clause->pcrel_idx = pcrel_idx;
1846 for (unsigned i = max_tuples - clause->tuple_count; i < max_tuples; ++i) {
1847 bi_tuple *tuple = &clause->tuples[i];
1868 clause->constant_count = constant_words;
1869 memcpy(clause->constants, constant_pairs, sizeof(constant_pairs));
1872 bi_instr *last = clause->tuples[max_tuples - 1].add;
1873 clause->next_clause_prefetch = !last || (last->op != BI_OPCODE_JUMP);
1874 clause->block = block;
1876 clause->ftz = (clause_state.ftz == BI_FTZ_STATE_ENABLE);
1880 memmove(clause->tuples,
1881 clause->tuples + (max_tuples - clause->tuple_count),
1882 clause->tuple_count * sizeof(clause->tuples[0]));
1888 for (unsigned t = 1; t < clause->tuple_count; ++t)
1889 bi_rewrite_passthrough(clause->tuples[t - 1], clause->tuples[t]);
1891 return clause;
1917 /* Back-to-back bit affects only the last clause of a block,
1932 bi_foreach_clause_in_block(block, clause) {
1933 for (unsigned i = 0; i < clause->tuple_count; ++i) {
1934 bi_foreach_instr_in_tuple(&clause->tuples[i], ins) {
2036 * clause of a shader. v6 requires adding a NOP clause with the depedency. */
2048 /* Fetch the first clause of the shader */
2050 bi_clause *clause = bi_next_clause(ctx, block, NULL);
2052 if (!clause || !(clause->dependencies & ((1 << BIFROST_SLOT_ELDEST_DEPTH) |
2057 * clause */
2067 .block = clause->block,
2073 list_add(&new_clause->link, &clause->block->clauses);