pan/bi: Use is_staging_src helper

This will allow us to have a separate set of staging sources, which will
be useful for dual-source blending.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13714>
This commit is contained in:
Alyssa Rosenzweig 2021-11-08 09:49:19 -05:00 committed by Marge Bot
parent c4da1b84d3
commit 251b1c1753
4 changed files with 11 additions and 5 deletions

View File

@ -70,7 +70,7 @@ bi_opt_copy_prop(bi_context *ctx)
bi_index use = ins->src[s];
if (use.type != BI_INDEX_NORMAL || use.reg) continue;
if (s == 0 && bi_opcode_props[ins->op].sr_read) continue;
if (bi_is_staging_src(ins, s)) continue;
bi_index repl = replacement[bi_word_node(use)];

View File

@ -161,7 +161,7 @@ bi_opt_cse(bi_context *ctx)
/* Rewrite before trying to CSE anything so we converge
* locally in one iteration */
bi_foreach_src(instr, s) {
if (s == 0 && bi_opcode_props[instr->op].sr_read)
if (bi_is_staging_src(instr, s))
continue;
if (!bi_is_ssa(instr->src[s]))

View File

@ -671,7 +671,7 @@ bi_reads_t(bi_instr *ins, unsigned src)
/* Staging register reads may happen before the succeeding register
* block encodes a write, so effectively there is no passthrough */
if (src == 0 && bi_opcode_props[ins->op].sr_read)
if (bi_is_staging_src(ins, src))
return false;
/* Bifrost cores newer than Mali G71 have restrictions on swizzles on
@ -823,7 +823,7 @@ bi_tuple_is_new_src(bi_instr *instr, struct bi_reg_state *reg, unsigned src_idx)
return false;
/* Staging register reads bypass the usual register file mechanism */
if (src_idx == 0 && bi_opcode_props[instr->op].sr_read)
if (bi_is_staging_src(instr, src_idx))
return false;
/* If a source is already read in the tuple, it is already counted */
@ -1863,7 +1863,7 @@ bi_check_fau_src(bi_instr *ins, unsigned s, uint32_t *constants, unsigned *cword
bi_index src = ins->src[s];
/* Staging registers can't have FAU accesses */
if (s == 0 && bi_opcode_props[ins->op].sr_read)
if (bi_is_staging_src(ins, s))
return (src.type != BI_INDEX_CONSTANT) && (src.type != BI_INDEX_FAU);
if (src.type == BI_INDEX_CONSTANT) {

View File

@ -497,6 +497,12 @@ typedef struct {
};
} bi_instr;
static inline bool
bi_is_staging_src(bi_instr *I, unsigned s)
{
return (s == 0) && bi_opcode_props[I->op].sr_read;
}
/* Represents the assignment of slots for a given bi_tuple */
typedef struct {