Mesa (main): broadcom/compiler: allow vectorization to larger scalar type
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jan 25 09:38:47 UTC 2022
Module: Mesa
Branch: main
Commit: 296fde31aadcb021a76295597a7d1ac366c1c62b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=296fde31aadcb021a76295597a7d1ac366c1c62b
Author: Iago Toral Quiroga <itoral at igalia.com>
Date: Fri Jan 21 13:10:55 2022 +0100
broadcom/compiler: allow vectorization to larger scalar type
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 <apinheiro at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14648>
---
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)
More information about the mesa-commit
mailing list