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 -# include -#endif - #if (CRYPTOPP_SSSE3_AVAILABLE) +#include "adv_simd.h" # include # include #endif @@ -32,6 +26,10 @@ # include #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) {