aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-02-17 19:43:51 +0100
committerMattias Andrée <maandree@kth.se>2022-02-17 19:43:51 +0100
commite1ff5cc788f1f418e75d63b8e4c4fe5554fbe2c8 (patch)
tree1639a0ba6c51ab27166b0171f75dad6c5300fe4b /common.h
parentbump version (diff)
downloadlibar2-1.2.tar.gz
libar2-1.2.tar.bz2
libar2-1.2.tar.xz
Some fixes1.2
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'common.h')
-rw-r--r--common.h8
1 files changed, 7 insertions, 1 deletions
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)];
};