summaryrefslogtreecommitdiff
path: root/blake2.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2016-07-12 23:05:00 -0400
committerJeffrey Walton <noloader@gmail.com>2016-07-12 23:05:00 -0400
commit5080a065ce08e6987d1070465210a45ad4ca6f88 (patch)
treec7c5a1c8b1b4ab137937f350e745c3e065b07855 /blake2.cpp
parent8e5f25c0048911866cda09bed790482ecda99563 (diff)
downloadcryptopp-git-5080a065ce08e6987d1070465210a45ad4ca6f88.tar.gz
Clear Valgrind findings under -Ofast
Diffstat (limited to 'blake2.cpp')
-rw-r--r--blake2.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/blake2.cpp b/blake2.cpp
index 593795d7..2cc68ef2 100644
--- a/blake2.cpp
+++ b/blake2.cpp
@@ -28,22 +28,24 @@ NAMESPACE_BEGIN(CryptoPP)
# undef CRYPTOPP_BOOL_SSE4_INTRINSICS_AVAILABLE
#endif
+// Apple Clang 6.0/Clang 3.5 does not have SSSE3 intrinsics
+// http://llvm.org/bugs/show_bug.cgi?id=20213
+#if (defined(CRYPTOPP_APPLE_CLANG_VERSION) && (CRYPTOPP_APPLE_CLANG_VERSION <= 60000)) || (defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION <= 30500))
+# undef CRYPTOPP_BOOL_SSE4_INTRINSICS_AVAILABLE
+#endif
+
// SunCC needs 12.4 for _mm_set_epi64x, _mm_blend_epi16, _mm_shuffle_epi16, etc
#if defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x5130)
# undef CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE
# undef CRYPTOPP_BOOL_SSE4_INTRINSICS_AVAILABLE
-#elif (__SUNPRO_CC >= 0x5130)
+#endif
+
+#if defined(CRYPTOPP_BOOL_SSE4_INTRINSICS_AVAILABLE) && ((__SUNPRO_CC >= 0x5130) || defined(__clang__))
# include <emmintrin.h> // _mm_set_epi64x
# include <smmintrin.h> // _mm_blend_epi16
# include <tmmintrin.h> // _mm_shuffle_epi16
#endif
-// Apple Clang 6.0/Clang 3.5 does not have SSSE3 intrinsics
-// http://llvm.org/bugs/show_bug.cgi?id=20213
-#if (defined(CRYPTOPP_APPLE_CLANG_VERSION) && (CRYPTOPP_APPLE_CLANG_VERSION <= 60000)) || (defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION <= 30500))
-# undef CRYPTOPP_BOOL_SSE4_INTRINSICS_AVAILABLE
-#endif
-
// C/C++ implementation
static void BLAKE2_CXX_Compress32(const byte* input, BLAKE2_State<word32, false>& state);
static void BLAKE2_CXX_Compress64(const byte* input, BLAKE2_State<word64, true>& state);