From 40e3d8e0e6d3b7aaf2f7fa63ba8d8a4fae7e8ebe Mon Sep 17 00:00:00 2001 From: Romaric Jodin Date: Fri, 14 Nov 2025 15:14:54 +0100 Subject: [PATCH] pan/bi: improve vectorization of 8bit alu Keep/make 2-element vector at least, and 4-element vector for supported opcode. Reviewed-by: Christoph Pillmayer Part-of: --- src/panfrost/compiler/bifrost_compile.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/panfrost/compiler/bifrost_compile.c b/src/panfrost/compiler/bifrost_compile.c index bfb6f52632a..258e24d5b36 100644 --- a/src/panfrost/compiler/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost_compile.c @@ -5533,7 +5533,16 @@ bi_vectorize_filter(const nir_instr *instr, const void *data) } int dst_bit_size = alu->def.bit_size; - if (dst_bit_size == 16) + if (dst_bit_size == 8) + switch (alu->op) { + case nir_op_imul: + case nir_op_i2i8: + case nir_op_u2u8: + return 4; + default: + return 2; + } + else if (dst_bit_size == 16) return 2; else return 1;