summaryrefslogtreecommitdiff
path: root/sha-simd.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-09-12 05:29:51 -0400
committerJeffrey Walton <noloader@gmail.com>2017-09-12 05:29:51 -0400
commit17bf824790e071bde20a318b86ff51800cfb1015 (patch)
treec36e03e72c236f0102de0a8eff71ae4a2d491f41 /sha-simd.cpp
parent81a272b046e649873569309a10104b682f44b308 (diff)
downloadcryptopp-git-17bf824790e071bde20a318b86ff51800cfb1015.tar.gz
Guard <arm_acle.h> include for GCC 4.8
Use system includes for <arm_neon.h> and <arm_acle.h>
Diffstat (limited to 'sha-simd.cpp')
-rw-r--r--sha-simd.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/sha-simd.cpp b/sha-simd.cpp
index 5f8f92f3..126463d8 100644
--- a/sha-simd.cpp
+++ b/sha-simd.cpp
@@ -11,25 +11,27 @@
#include "sha.h"
#include "misc.h"
-// Clang and GCC hoops...
+// We set CRYPTOPP_ARM_SHA_AVAILABLE based on compiler version.
+// If the crypto is not available, then we have to disable it here.
#if !(defined(__ARM_FEATURE_CRYPTO) || defined(_MSC_VER))
# undef CRYPTOPP_ARM_SHA_AVAILABLE
#endif
-#if (CRYPTOPP_SHANI_AVAILABLE)
-# include "nmmintrin.h"
-# include "immintrin.h"
+#if (CRYPTOPP_CLMUL_AVAILABLE)
+# include <nmmintrin.h>
+# include <immintrin.h>
#endif
-#if (CRYPTOPP_ARM_SHA_AVAILABLE)
-# include "arm_neon.h"
+#if (CRYPTOPP_ARM_NEON_AVAILABLE)
+# include <arm_neon.h>
#endif
// Don't include <arm_acle.h> when using Apple Clang. Early Apple compilers
// fail to compile with <arm_acle.h> included. Later Apple compilers compile
-// intrinsics without <arm_acle.h> included.
-#if (CRYPTOPP_ARM_SHA_AVAILABLE) && !defined(CRYPTOPP_APPLE_CLANG_VERSION)
-# include "arm_acle.h"
+// intrinsics without <arm_acle.h> included. Also avoid it with GCC 4.8.
+#if (CRYPTOPP_ARM_SHA_AVAILABLE) && !defined(CRYPTOPP_APPLE_CLANG_VERSION) && \
+ (!defined(CRYPTOPP_GCC_VERSION) || (CRYPTOPP_GCC_VERSION >= 40900))
+# include <arm_acle.h>
#endif
#ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY