diff --git a/blake2-simd.cpp b/blake2-simd.cpp index bd6ffb84..dc3f407a 100644 --- a/blake2-simd.cpp +++ b/blake2-simd.cpp @@ -11,6 +11,10 @@ #include "misc.h" #include "blake2.h" +#if (CRYPTOPP_SSE2_AVAILABLE) +# include "emmintrin.h" +#endif + #if (CRYPTOPP_SSE42_AVAILABLE) # include "nmmintrin.h" #endif diff --git a/gcm.cpp b/gcm.cpp index e75c43a4..5341f36e 100644 --- a/gcm.cpp +++ b/gcm.cpp @@ -28,7 +28,7 @@ NAMESPACE_BEGIN(CryptoPP) -#if (CRYPTOPP_CLMUL_AVAILABLE) +#if (CRYPTOPP_SSE2_AVAILABLE) # include "emmintrin.h" #endif diff --git a/rijndael-simd.cpp b/rijndael-simd.cpp index b14b3d5b..83c5dbf9 100644 --- a/rijndael-simd.cpp +++ b/rijndael-simd.cpp @@ -31,12 +31,10 @@ #endif #if (CRYPTOPP_SSE41_AVAILABLE) -// Hack... Clang conflates SSE4.1 and SSE4.2. Without __SSE4_2__, -// early Apple and LLVM compilers fail with "SSE4.2 instruction -// set not enabled" when "nmmintrin.h" is included. Its non-trivial -// for us to automatically add -msse4.2 for Apple Clang. We also want -// to avoid problems on low-end Atoms which have AES but lack SSE4.2. -# if defined(__clang__) +// Hack... GCC 4.8, LLVM Clang 3.5 and Apple Clang 6.0 conflates SSE4.1 +// and SSE4.2. Without __SSE4_2__, early compilers fail with "SSE4.2 +// instruction set not enabled" when "nmmintrin.h" is included. +# if defined(__clang__) || defined(__GNUC__) # define __SSE4_2__ 1 # endif # include "nmmintrin.h"