pan/bi: Do not allow passthrough for instructions disallowing temps

Previously we were allowing passthrough to temps without using
bi_reads_temps.

This was causing instructions like CLPER to create undefined encodings.

We now check if the instruction support temps.

Fixes: 4252fb84f4 ("pan/bi: Add passthrough register rewriting helper")
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36006>
(cherry picked from commit 48d716a05f)
This commit is contained in:
Mary Guillemard 2025-07-08 13:07:08 +02:00 committed by Eric Engestrom
parent a146695ab8
commit be9e46d794
2 changed files with 5 additions and 1 deletions

View file

@ -4434,7 +4434,7 @@
"description": "pan/bi: Do not allow passthrough for instructions disallowing temps",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "4252fb84f4f0ad5ec6f3d966fec308a3b42ffd7a",
"notes": null

View file

@ -1366,6 +1366,10 @@ bi_use_passthrough(bi_instr *ins, bi_index old, enum bifrost_packed_src new,
if ((i == 0 || i == 4) && except_sr)
continue;
if ((new == BIFROST_SRC_PASS_FMA || new == BIFROST_SRC_PASS_ADD) &&
!bi_reads_temps(ins, i))
continue;
if (bi_is_word_equiv(ins->src[i], old)) {
ins->src[i].type = BI_INDEX_PASS;
ins->src[i].value = new;