From e1ff5cc788f1f418e75d63b8e4c4fe5554fbe2c8 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 17 Feb 2022 19:43:51 +0100 Subject: Some fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- common.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'common.h') diff --git a/common.h b/common.h index 432dff2..fca3af1 100644 --- a/common.h +++ b/common.h @@ -96,9 +96,15 @@ #if defined(__x86_64__) && defined(LIBAR2_TARGET__) # define MAX_SIMD_ALIGNMENT 64 # define SIMD_ALIGNED _Alignas(MAX_SIMD_ALIGNMENT) +# if defined(__GNUC__) +# define SIMD_ALIGNED_ATTRIBUTE __attribute__((__aligned__(MAX_SIMD_ALIGNMENT))) +# else +# define SIMD_ALIGNED_ATTRIBUTE +# endif #else # define MAX_SIMD_ALIGNMENT 1 # define SIMD_ALIGNED /* use the types native alignment */ +# define SIMD_ALIGNED_ATTRIBUTE /* ditto */ #endif @@ -112,7 +118,7 @@ #define ERASE_STRUCT(S) libar2_erase(&(S), sizeof(S)) -struct block { +struct SIMD_ALIGNED_ATTRIBUTE block { uint_least64_t w[1024 / (64 / 8)]; }; -- cgit v1.2.3-70-g09d2