Fix compile under Clang 3.5 due to use of SSE4.1

Both Apple and LLVM Clang want -msse4.2 even when only SSE4.1 is used. Sidestep it because we don't know how it will affect some of the lower end Atoms.

84877:/usr/include/clang/3.5.0/include/nmmintrin.h:28:2: error: "SSE4.2 instruction set not enabled"
84878:#error "SSE4.2 instruction set not enabled"
84880:rijndael-simd.cpp:466:26: error: use of undeclared identifier '_mm_extract_epi32'; did you mean '_mm_extract_epi16'?
84887:rijndael-simd.cpp:480:11: error: use of undeclared identifier '_mm_insert_epi32'; did you mean '_mm_insert_epi16'?
84894:rijndael-simd.cpp:485:11: error: use of undeclared identifier '_mm_insert_epi32'; did you mean '_mm_insert_epi16'?
...
pull/461/head
Jeffrey Walton 2017-08-07 12:03:17 -04:00
parent a8b3327265
commit 42d91b76fc
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
2 changed files with 8 additions and 8 deletions

View File

@ -73,10 +73,10 @@ bool CPU_TryNEON_ARM()
}
return result;
# else
# if defined(__android__) && defined(CRYPTOPP_BOOL_ARM64)
# if defined(__android__) && (CRYPTOPP_BOOL_ARM64)
if (android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_ASIMD)
return true;
# elif defined(__android__) && defined(CRYPTOPP_BOOL_ARM32)
# elif defined(__android__) && (CRYPTOPP_BOOL_ARM32)
if (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON)
return true;
# elif defined(__linux__) && defined(__aarch64__)

View File

@ -31,12 +31,12 @@
#endif
#if (CRYPTOPP_SSE41_AVAILABLE)
// Hack... Apple conflates SSE4.1 and SSE4.2. Without __SSE4_2__,
// Apple fails the compile 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 (CRYPTOPP_APPLE_CLANG_VERSION)
// 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__)
# define __SSE4_2__ 1
# endif
# include "nmmintrin.h"