summaryrefslogtreecommitdiff
path: root/lsh512.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2021-04-21 06:35:27 -0400
committerJeffrey Walton <noloader@gmail.com>2021-04-21 06:35:27 -0400
commit29cfba8463750c22ef1fa223d8c2ffade13b43a8 (patch)
tree1a34021935aff7e40b29e88923a1c594b758922f /lsh512.cpp
parent08a34cc8aa1d686a50d7d0c2e3a44668c6f924a6 (diff)
downloadcryptopp-git-29cfba8463750c22ef1fa223d8c2ffade13b43a8.tar.gz
Fix compile on Apple with -march=native when AVX2 is available
Diffstat (limited to 'lsh512.cpp')
-rw-r--r--lsh512.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/lsh512.cpp b/lsh512.cpp
index 30b1c8d2..b6259355 100644
--- a/lsh512.cpp
+++ b/lsh512.cpp
@@ -33,20 +33,26 @@
# if (defined(__SSE2__) && defined(__amd64__)) || (defined(_MSC_VER) && defined(_M_X64))
# define CRYPTOPP_LSH512_SSE2_AVAILABLE 1
# endif
-# if (defined(__SSSE3__) && defined(__amd64__))
+# if defined(__SSSE3__) && defined(__amd64__)
# define CRYPTOPP_LSH512_SSSE3_AVAILABLE 1
# endif
-# if (defined(__XOP__) && defined(__amd64__))
+# if defined(__XOP__) && defined(__amd64__)
# define CRYPTOPP_LSH512_XOP_AVAILABLE 1
# endif
-# if (defined(__AVX__) && defined(__amd64__))
+# if defined(__AVX__) && defined(__amd64__)
# define CRYPTOPP_LSH512_AVX_AVAILABLE 1
# endif
-# if (defined(__AVX2__) && defined(__amd64__))
+# if defined(__AVX2__) && defined(__amd64__)
# define CRYPTOPP_LSH512_AVX2_AVAILABLE 1
# endif
#endif
+// Apple and broken compile with -march=native when AVX2 is available.
+// https://travis-ci.org/github/noloader/cryptopp/jobs/767844407
+#if defined(__AVX2__) && defined(CRYPTOPP_APPLE_CLANG_VERSION))
+# undef CRYPTOPP_LSH256_AVX2_AVAILABLE
+#endif
+
#if defined(CRYPTOPP_LSH512_SSSE3_AVAILABLE)
# include <tmmintrin.h>
#endif