From a5801b1a2314a3d8052338c73835c4286eb90db5 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Tue, 24 Mar 2026 09:23:29 -0400 Subject: [PATCH] pan/bi: Simplify unpack_64_2x32_split_* Reviewed-by: Lars-Ivar Hesselberg Simonsen Reviewed-by: Christoph Pillmayer Reviewed-by: Lorenzo Rossi Part-of: --- src/panfrost/compiler/bifrost/bifrost_compile.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/panfrost/compiler/bifrost/bifrost_compile.c b/src/panfrost/compiler/bifrost/bifrost_compile.c index 139f046f55a..ffc9c66d9e1 100644 --- a/src/panfrost/compiler/bifrost/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost/bifrost_compile.c @@ -2976,17 +2976,14 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr) return; } - case nir_op_unpack_64_2x32_split_x: { - unsigned chan = (instr->src[0].swizzle[0] * 2) + 0; - bi_mov_i32_to(b, dst, - bi_extract(b, bi_src_index(&instr->src[0].src), chan)); - return; - } - + case nir_op_unpack_64_2x32_split_x: case nir_op_unpack_64_2x32_split_y: { - unsigned chan = (instr->src[0].swizzle[0] * 2) + 1; - bi_mov_i32_to(b, dst, - bi_extract(b, bi_src_index(&instr->src[0].src), chan)); + bi_index idx = bi_src_index(&instr->src[0].src); + + unsigned offset = instr->op == nir_op_unpack_64_2x32_split_x ? 0 : 1; + unsigned chan = instr->src[0].swizzle[0] * 2 + offset; + + bi_mov_i32_to(b, dst, bi_extract(b, idx, chan)); return; }