aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcryptobox
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-03-29 15:48:22 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-03-29 15:48:22 +0100
commite487db32bc47aadb69753cffbb6c554a3153dc00 (patch)
tree8035a52d01fcdaec65ecec6f713691a63a62be27 /src/libcryptobox
parent251fdc38e66e7b75c34793a162c9cc5a7467e834 (diff)
downloadrspamd-e487db32bc47aadb69753cffbb6c554a3153dc00.tar.gz
rspamd-e487db32bc47aadb69753cffbb6c554a3153dc00.zip
[Minor] Now fight with cmake stupidity
Diffstat (limited to 'src/libcryptobox')
-rw-r--r--src/libcryptobox/CMakeLists.txt12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/libcryptobox/CMakeLists.txt b/src/libcryptobox/CMakeLists.txt
index 2f1a3d57c..3c83f21f9 100644
--- a/src/libcryptobox/CMakeLists.txt
+++ b/src/libcryptobox/CMakeLists.txt
@@ -72,13 +72,19 @@ IF("${ARCH}" STREQUAL "x86_64")
#endif
#include <immintrin.h>
-void cmkcheckweak() __attribute__((weak));
+static void foo(const char* a) __attribute__((__target__(\"avx2\")));
+static void foo(const char* a)
+{
+ __m256i str = _mm256_loadu_si256((__m256i *)a);
+ __m256i t = _mm256_loadu_si256((__m256i *)a + 1);
+ _mm256_add_epi8(str, t);
+}
int main(int argc, char** argv) {
- __m256i str = _mm256_loadu_si256((__m256i *)argv[0]);
+ foo(argv[0]);
}" HAVE_AVX2_C_COMPILER)
IF(NOT HAVE_AVX2_C_COMPILER)
MESSAGE(STATUS "Your compiler has broken AVX2 support")
- UNSET(HAVE_AVX2)
+ UNSET(HAVE_AVX2 CACHE)
ENDIF()
ENDIF()
SET(ASM_CODE "vpaddq %xmm0, %xmm0, %xmm0")