pan/bi: Move nir_op_mov handling to the top

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40576>
This commit is contained in:
Faith Ekstrand 2026-03-24 11:17:50 -04:00 committed by Marge Bot
parent 0b029f319f
commit 682ab923e6

View file

@ -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);