From 666b752ca2359f411792cb8a1f5f4fd7dc36c357 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 9 May 2024 22:26:49 +0200 Subject: [PATCH] clang >= 18 requires evex512 to use AVX512 --- src/aegis128x4/aegis128x4_avx512.c | 9 +++++++-- src/aegis256x4/aegis256x4_avx512.c | 7 ++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/aegis128x4/aegis128x4_avx512.c b/src/aegis128x4/aegis128x4_avx512.c index 1501b6d..610aa0f 100644 --- a/src/aegis128x4/aegis128x4_avx512.c +++ b/src/aegis128x4/aegis128x4_avx512.c @@ -13,8 +13,13 @@ # ifdef HAVE_VAESINTRIN_H # ifdef __clang__ -# pragma clang attribute push(__attribute__((target("vaes,avx512f"))), \ - apply_to = function) +# if __clang_major__ >= 18 +# pragma clang attribute push(__attribute__((target("vaes,avx512f,evex512"))), \ + apply_to = function) +# else +# pragma clang attribute push(__attribute__((target("vaes,avx512f"))), \ + apply_to = function) +# endif # elif defined(__GNUC__) # pragma GCC target("vaes,avx512f") # endif diff --git a/src/aegis256x4/aegis256x4_avx512.c b/src/aegis256x4/aegis256x4_avx512.c index 652fee9..20ff319 100644 --- a/src/aegis256x4/aegis256x4_avx512.c +++ b/src/aegis256x4/aegis256x4_avx512.c @@ -13,8 +13,13 @@ # ifdef HAVE_VAESINTRIN_H # ifdef __clang__ -# pragma clang attribute push(__attribute__((target("vaes,avx512f"))), \ +# if __clang_major__ >= 18 +# pragma clang attribute push(__attribute__((target("vaes,avx512f,evex512"))), \ apply_to = function) +# else +# pragma clang attribute push(__attribute__((target("vaes,avx512f"))), \ + apply_to = function) +# endif # elif defined(__GNUC__) # pragma GCC target("vaes,avx512f") # endif