From 89a3b78d6818a7e862610a7619bde1a4daa95305 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 17 Feb 2022 11:08:42 +0100 Subject: Add optimisations (no yet used) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- common.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'common.h') diff --git a/common.h b/common.h index 958c7b0..edfaed7 100644 --- a/common.h +++ b/common.h @@ -29,7 +29,8 @@ #if defined(__GNUC__) -# define LIBAR2_WEAKLY_LINKED__ __attribute__((weak)) +# define LIBAR2_WEAKLY_LINKED__ __attribute__((__weak__)) +# define LIBAR2_TARGET__(TARGETS) __attribute__((__target__(TARGETS))) #endif @@ -86,6 +87,15 @@ #endif +#if defined(__x86_64__) && defined(LIBAR2_TARGET__) +# define MAX_SIMD_ALIGNMENT 64 +# define SIMD_ALIGNED _Alignas(MAX_SIMD_ALIGNMENT) +#else +# define MAX_SIMD_ALIGNMENT 1 +# define SIMD_ALIGNED /* use the types native alignment */ +#endif + + #define ELEMSOF(ARR) (sizeof(ARR) / sizeof(*(ARR))) #define MAX(A, B) ((A) > (B) ? (A) : (B)) -- cgit v1.2.3-70-g09d2