summaryrefslogtreecommitdiff
path: root/crc-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 /crc-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 'crc-simd.cpp')
-rw-r--r--crc-simd.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/crc-simd.cpp b/crc-simd.cpp
index db6ee303..890aa4d9 100644
--- a/crc-simd.cpp
+++ b/crc-simd.cpp
@@ -10,20 +10,26 @@
#include "config.h"
#include "misc.h"
-// Clang and GCC hoops...
+// We set CRYPTOPP_ARM_CRC32_AVAILABLE based on compiler version.
+// If the crypto is not available, then we have to disable it here.
#if !(defined(__ARM_FEATURE_CRC32) || defined(_MSC_VER))
# undef CRYPTOPP_ARM_CRC32_AVAILABLE
#endif
-#if (CRYPTOPP_SSE42_AVAILABLE)
-# include "nmmintrin.h"
+#if (CRYPTOPP_CLMUL_AVAILABLE)
+# include <nmmintrin.h>
+#endif
+
+#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_CRC32_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_CRC32_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