diff options
author | Mattias Andrée <maandree@kth.se> | 2022-02-17 11:08:42 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2022-02-17 11:11:09 +0100 |
commit | 89a3b78d6818a7e862610a7619bde1a4daa95305 (patch) | |
tree | 521ed8f8f341d9e39540b16fe7835e3fd697ce58 /common.h | |
parent | Fix previous commit (diff) | |
download | libar2-89a3b78d6818a7e862610a7619bde1a4daa95305.tar.gz libar2-89a3b78d6818a7e862610a7619bde1a4daa95305.tar.bz2 libar2-89a3b78d6818a7e862610a7619bde1a4daa95305.tar.xz |
Add optimisations (no yet used)
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | common.h | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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)) |