From 79f8c1ca9a0abd30fe854a734eb66f1da7d123f8 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Tue, 24 Mar 2026 11:16:42 -0400 Subject: [PATCH] pan/bi: Unify handling of unpack_* These are just a fancy mov on Mali. We need to use bi_make_vec_to() because it handles 64-bit movs as well. Reviewed-by: Lars-Ivar Hesselberg Simonsen Reviewed-by: Christoph Pillmayer Reviewed-by: Lorenzo Rossi Part-of: --- .../compiler/bifrost/bifrost_compile.c | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/panfrost/compiler/bifrost/bifrost_compile.c b/src/panfrost/compiler/bifrost/bifrost_compile.c index d82ac13c8ed..139f046f55a 100644 --- a/src/panfrost/compiler/bifrost/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost/bifrost_compile.c @@ -2948,16 +2948,14 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr) return; } + case nir_op_unpack_32_2x16: case nir_op_unpack_32_4x8: - case nir_op_unpack_32_2x16: { - /* Should have been scalarized */ - assert(sz == 8 || sz == 16); - assert(comps * sz == 32); - - bi_index vec = bi_src_index(&instr->src[0].src); + case nir_op_unpack_64_2x32: + case nir_op_unpack_64_4x16: { + assert(comps * sz == src_sz); + bi_index idx = bi_src_index(&instr->src[0].src); unsigned chan = instr->src[0].swizzle[0]; - - bi_mov_i32_to(b, dst, bi_extract(b, vec, chan)); + bi_make_vec_to(b, dst, &idx, &chan, 1, src_sz); return; } @@ -2978,14 +2976,6 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr) return; } - case nir_op_unpack_64_2x32: { - unsigned chan = (instr->src[0].swizzle[0] * 2) + 0; - bi_index idx = bi_src_index(&instr->src[0].src); - bi_collect_v2i32_to(b, dst, bi_extract(b, idx, chan + 0), - bi_extract(b, idx, chan + 1)); - return; - } - case nir_op_unpack_64_2x32_split_x: { unsigned chan = (instr->src[0].swizzle[0] * 2) + 0; bi_mov_i32_to(b, dst,