summaryrefslogtreecommitdiff
path: root/cham_simd.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-12-29 00:39:11 -0500
committerJeffrey Walton <noloader@gmail.com>2018-12-29 00:39:11 -0500
commitdf47185573d9ce6e8840722ffeec447e02344d4f (patch)
tree1fc922d216d8327ecfe7f7a1e4bc452a60916a9e /cham_simd.cpp
parent8edc5cf2d58ee330eeb8b29d58a520008da9c599 (diff)
downloadcryptopp-git-df47185573d9ce6e8840722ffeec447e02344d4f.tar.gz
Fix CHAM build when SSSE3 not available
Diffstat (limited to 'cham_simd.cpp')
-rw-r--r--cham_simd.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/cham_simd.cpp b/cham_simd.cpp
index b56e6d76..bf698d90 100644
--- a/cham_simd.cpp
+++ b/cham_simd.cpp
@@ -10,20 +10,14 @@
#include "cham.h"
#include "misc.h"
-#include "adv_simd.h"
// Uncomment for benchmarking C++ against SSE or NEON.
// Do so in both simon.cpp and simon-simd.cpp.
// #undef CRYPTOPP_SSSE3_AVAILABLE
// #undef CRYPTOPP_ARM_NEON_AVAILABLE
-#if defined(CRYPTOPP_SSE2_AVAILABLE)
-# define CRYPTOPP_AVX512_ROTATE 1
-# include <xmmintrin.h>
-# include <emmintrin.h>
-#endif
-
#if (CRYPTOPP_SSSE3_AVAILABLE)
+#include "adv_simd.h"
# include <pmmintrin.h>
# include <tmmintrin.h>
#endif
@@ -32,6 +26,10 @@
# include <ammintrin.h>
#endif
+#ifdef __AVX512F__
+# define CRYPTOPP_AVX512_ROTATE 1
+#endif
+
// Squash MS LNK4221 and libtool warnings
extern const char CHAM_SIMD_FNAME[] = __FILE__;
@@ -68,7 +66,6 @@ inline __m128i RotateRight16(const __m128i& val)
#endif
}
-// Faster than two Shifts and an Or. Thanks to Louis Wingers and Bryan Weeks.
template <>
inline __m128i RotateLeft16<8>(const __m128i& val)
{
@@ -80,7 +77,6 @@ inline __m128i RotateLeft16<8>(const __m128i& val)
#endif
}
-// Faster than two Shifts and an Or. Thanks to Louis Wingers and Bryan Weeks.
template <>
inline __m128i RotateRight16<8>(const __m128i& val)
{