mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 15:40:11 +01:00
pan/bi: Add trivial rewrite helpers
We need to do certain rewrites during scheduling before RA runs in order to satsify scheduler post-conditions. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8354>
This commit is contained in:
parent
66100895ff
commit
fc7770b1dd
1 changed files with 26 additions and 0 deletions
|
|
@ -890,6 +890,32 @@ bi_rewrite_passthrough(bi_tuple prec, bi_tuple succ)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
bi_rewrite_fau_to_pass(bi_tuple *tuple)
|
||||
{
|
||||
bi_foreach_instr_and_src_in_tuple(tuple, ins, s) {
|
||||
if (ins->src[s].type != BI_INDEX_FAU) continue;
|
||||
|
||||
ins->src[s] = bi_passthrough(ins->src[s].offset ?
|
||||
BIFROST_SRC_FAU_HI : BIFROST_SRC_FAU_LO);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
bi_rewrite_zero(bi_instr *ins, bool fma)
|
||||
{
|
||||
bi_foreach_src(ins, s) {
|
||||
bi_index src = ins->src[s];
|
||||
unsigned swizzle = src.swizzle;
|
||||
|
||||
if (src.type == BI_INDEX_CONSTANT && src.value == 0) {
|
||||
assert(!src.abs && !src.neg);
|
||||
ins->src[s] = bi_passthrough(
|
||||
fma ? BIFROST_SRC_STAGE : BIFROST_SRC_FAU_LO);
|
||||
ins->src[s].swizzle = swizzle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue