From 682ab923e6d2164ef7471c22365c5f849e15f07f Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Tue, 24 Mar 2026 11:17:50 -0400 Subject: [PATCH] pan/bi: Move nir_op_mov handling to the top Reviewed-by: Lars-Ivar Hesselberg Simonsen Reviewed-by: Christoph Pillmayer Reviewed-by: Lorenzo Rossi Part-of: --- .../compiler/bifrost/bifrost_compile.c | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/panfrost/compiler/bifrost/bifrost_compile.c b/src/panfrost/compiler/bifrost/bifrost_compile.c index 71245aa2be6..6d01b0cbe39 100644 --- a/src/panfrost/compiler/bifrost/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost/bifrost_compile.c @@ -2894,6 +2894,21 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr) * are the exceptions that need to handle swizzles specially. */ switch (instr->op) { + case nir_op_mov: { + bi_index idx = bi_src_index(&instr->src[0].src); + bi_index unoffset_srcs[4] = {idx, idx, idx, idx}; + + unsigned channels[4] = { + comps > 0 ? instr->src[0].swizzle[0] : 0, + comps > 1 ? instr->src[0].swizzle[1] : 0, + comps > 2 ? instr->src[0].swizzle[2] : 0, + comps > 3 ? instr->src[0].swizzle[3] : 0, + }; + + bi_make_vec_to(b, dst, unoffset_srcs, channels, comps, src_sz); + return; + } + case nir_op_vec2: case nir_op_vec3: case nir_op_vec4: @@ -3005,21 +3020,6 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr) return; } - case nir_op_mov: { - bi_index idx = bi_src_index(&instr->src[0].src); - bi_index unoffset_srcs[4] = {idx, idx, idx, idx}; - - unsigned channels[4] = { - comps > 0 ? instr->src[0].swizzle[0] : 0, - comps > 1 ? instr->src[0].swizzle[1] : 0, - comps > 2 ? instr->src[0].swizzle[2] : 0, - comps > 3 ? instr->src[0].swizzle[3] : 0, - }; - - bi_make_vec_to(b, dst, unoffset_srcs, channels, comps, src_sz); - return; - } - case nir_op_pack_32_2x16: { assert(comps == 1);