From 296fde31aadcb021a76295597a7d1ac366c1c62b Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Fri, 21 Jan 2022 13:10:55 +0100 Subject: [PATCH] broadcom/compiler: allow vectorization to larger scalar type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow to vectorize operations from a smaller bit-size into scalar operations of a larger bit-size. This allows us to turn 2x8-bit into a equivalent scalar 16-bit load/store. Reviewed-by: Alejandro PiƱeiro Part-of: --- src/broadcom/compiler/nir_to_vir.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/broadcom/compiler/nir_to_vir.c b/src/broadcom/compiler/nir_to_vir.c index 97804ccb844..2a6fdbfb3d6 100644 --- a/src/broadcom/compiler/nir_to_vir.c +++ b/src/broadcom/compiler/nir_to_vir.c @@ -2059,7 +2059,10 @@ mem_vectorize_callback(unsigned align_mul, unsigned align_offset, void *data) { /* TMU general access only supports 32-bit vectors */ - if (bit_size != 32) + if (bit_size > 32) + return false; + + if ((bit_size == 8 || bit_size == 16) && num_components > 1) return false; if (align_mul % 4 != 0 || align_offset % 4 != 0)