From 355af1e9038cd64b6b3c51d89cbc17a5faf6f367 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sun, 7 Jan 2024 19:07:37 -0400 Subject: [PATCH] agx: require min alignment for load/store vectorize fixes test_basic vload_constant Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/compiler/agx_compile.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c index 6a70f3cdc1b..1359b2eb220 100644 --- a/src/asahi/compiler/agx_compile.c +++ b/src/asahi/compiler/agx_compile.c @@ -2391,6 +2391,11 @@ mem_vectorize_cb(unsigned align_mul, unsigned align_offset, unsigned bit_size, unsigned num_components, nir_intrinsic_instr *low, nir_intrinsic_instr *high, void *data) { + /* Must be aligned to the size of the load */ + unsigned align = nir_combined_align(align_mul, align_offset); + if ((bit_size / 8) > align) + return false; + if (num_components > 4) return false;