From c76a7410dc96d67e74d849a468fc381d821f2fb9 Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Thu, 19 Jun 2025 17:22:31 +0200 Subject: [PATCH] panvk: fix bi_emit_alu calling bi_make_vec_to bi_emit_alu needs to fully set the vector of bi_index pass to bi_make_vec_to, as it is expected by the callee. Fixes: 3cc6a4c5 ("pan/bi: Handle swizzles in i2i8") Reviewed-by: Mary Guillemard Part-of: (cherry picked from commit bc973d687c9dd92c16eba107a215d9c5f37df6b4) --- .pick_status.json | 2 +- src/panfrost/compiler/bifrost_compile.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 58ea23081ab..308c6d4143b 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4824,7 +4824,7 @@ "description": "panvk: fix bi_emit_alu calling bi_make_vec_to", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "3cc6a4c5d033ae0ca6d53a53aa87a909988e3515", "notes": null diff --git a/src/panfrost/compiler/bifrost_compile.c b/src/panfrost/compiler/bifrost_compile.c index 6afcf9da11d..38337927aa6 100644 --- a/src/panfrost/compiler/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost_compile.c @@ -2893,11 +2893,14 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr) bi_index idx = bi_src_index(&instr->src[0].src); unsigned factor = src_sz / 8; unsigned chan[4] = {0}; + bi_index idxs[4]; - for (unsigned i = 0; i < comps; ++i) + for (unsigned i = 0; i < comps; ++i) { + idxs[i] = idx; chan[i] = instr->src[0].swizzle[i] * factor; + } - bi_make_vec_to(b, dst, &idx, chan, comps, 8); + bi_make_vec_to(b, dst, idxs, chan, comps, 8); return; }