From efc3491979e41c5e240d45e4aa2e1c9d201ee755 Mon Sep 17 00:00:00 2001 From: HowJMay Date: Fri, 18 Mar 2022 19:33:43 +0800 Subject: [PATCH] fix: Fix alignment in tests _mm_store_si128 and _mm_stream_si128 are aligned in 16 bytes --- tests/impl.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/impl.cpp b/tests/impl.cpp index 8de3cd95..1b194fa4 100644 --- a/tests/impl.cpp +++ b/tests/impl.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -2963,7 +2964,7 @@ result_t test_mm_stream_ps(const SSE2NEONTestImpl &impl, uint32_t iter) { const float *_a = impl.mTestFloatPointer1; __m128 a = load_m128(_a); - float p[4]; + alignas(16) float p[4]; _mm_stream_ps(p, a); ASSERT_RETURN(p[0] == _a[0]); @@ -6197,7 +6198,7 @@ result_t test_mm_store_sd(const SSE2NEONTestImpl &impl, uint32_t iter) result_t test_mm_store_si128(const SSE2NEONTestImpl &impl, uint32_t iter) { const int32_t *_a = (const int32_t *) impl.mTestIntPointer1; - int32_t p[4]; + alignas(16) int32_t p[4]; __m128i a = load_m128i(_a); _mm_store_si128((__m128i *) p, a); @@ -6312,7 +6313,7 @@ result_t test_mm_stream_pd(const SSE2NEONTestImpl &impl, uint32_t iter) result_t test_mm_stream_si128(const SSE2NEONTestImpl &impl, uint32_t iter) { const int32_t *_a = (const int32_t *) impl.mTestIntPointer1; - int32_t p[4]; + alignas(16) int32_t p[4]; __m128i a = load_m128i(_a); _mm_stream_si128((__m128i *) p, a);