From dceee75f87731c81b84720a0ade55738dbb19bf7 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Thu, 5 Feb 2026 21:52:58 -0500 Subject: [PATCH] pan/bi: Vectorize comparisons We've got vectorized comparison instructions going all the way back to Bifrost. We should probably stop splitting them. Reviewed-by: Christoph Pillmayer Part-of: --- src/panfrost/compiler/bifrost/bifrost_compile.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/panfrost/compiler/bifrost/bifrost_compile.c b/src/panfrost/compiler/bifrost/bifrost_compile.c index 3e53ebe7f55..60199fbf49d 100644 --- a/src/panfrost/compiler/bifrost/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost/bifrost_compile.c @@ -5587,8 +5587,10 @@ bi_vectorize_filter(const nir_instr *instr, const void *data) break; } - int dst_bit_size = alu->def.bit_size; - if (dst_bit_size == 8) + const uint8_t bit_size = nir_alu_instr_is_comparison(alu) + ? nir_src_bit_size(alu->src[0].src) + : alu->def.bit_size; + if (bit_size == 8) switch (alu->op) { case nir_op_imul: case nir_op_i2i8: @@ -5597,7 +5599,7 @@ bi_vectorize_filter(const nir_instr *instr, const void *data) default: return 2; } - else if (dst_bit_size == 16) + else if (bit_size == 16) return 2; else return 1;