From 48d51a1370f0facb54fa80864077fd7d769cb03d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Holger=20Hoffst=C3=A4tte?= Date: Mon, 4 Sep 2023 14:00:20 +0200 Subject: [PATCH] Fix __m128i_u / __m256i_u alignment MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Building with clang-16 complains with: ./simd-checksum-x86_64.cpp:204:25: warning: passing 1-byte aligned argument to 16-byte aligned parameter 1 of '_mm_store_si128' may result in an unaligned pointer access [-Walign-mismatch] Signed-off-by: Holger Hoffstätte --- simd-checksum-x86_64.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simd-checksum-x86_64.cpp b/simd-checksum-x86_64.cpp index 33f26e92..d649091e 100644 --- a/simd-checksum-x86_64.cpp +++ b/simd-checksum-x86_64.cpp @@ -68,8 +68,8 @@ #endif // Missing from the headers on gcc 6 and older, clang 8 and older -typedef long long __m128i_u __attribute__((__vector_size__(16), __may_alias__, __aligned__(1))); -typedef long long __m256i_u __attribute__((__vector_size__(32), __may_alias__, __aligned__(1))); +typedef long long __m128i_u __attribute__((__vector_size__(16), __may_alias__, __aligned__(16))); +typedef long long __m256i_u __attribute__((__vector_size__(32), __may_alias__, __aligned__(16))); /* Compatibility macros to let our SSSE3 algorithm run with only SSE2. These used to be neat individual functions with target attributes switching between SSE2 and SSSE3 implementations -- 2.11.4.GIT