aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
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)];
};