aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-02-17 11:08:42 +0100
committerMattias Andrée <maandree@kth.se>2022-02-17 11:11:09 +0100
commit89a3b78d6818a7e862610a7619bde1a4daa95305 (patch)
tree521ed8f8f341d9e39540b16fe7835e3fd697ce58 /common.h
parentFix previous commit (diff)
downloadlibar2-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 'common.h')
-rw-r--r--common.h12
1 files changed, 11 insertions, 1 deletions
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))