From 65222dfe9ee8e480d3c2ee32adc6514ba6e719d8 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sat, 9 Dec 2017 13:07:50 -0500 Subject: [PATCH] Move location of CRYPTOPP_ARM_ACLE_AVAILABLE test in config.h This should make it easier to detect when we need to include --- config.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/config.h b/config.h index f6c6caa8..2a435c4b 100644 --- a/config.h +++ b/config.h @@ -562,22 +562,12 @@ NAMESPACE_END // Requires ARMv7 and ACLE 1.0. Testing shows ARMv7 is really ARMv7a under most toolchains. // Android still uses ARMv5 and ARMv6 so we have to be conservative when enabling NEON. #if !defined(CRYPTOPP_ARM_NEON_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM) -# if defined(__ARM_NEON__) || defined(__ARM_FEATURE_NEON) || \ +# if defined(__ARM_NEON) || defined(__ARM_FEATURE_NEON) || defined(__ARM_FEATURE_ASIMD) || \ (__ARM_ARCH >= 7) || (CRYPTOPP_MSC_VERSION >= 1700) # define CRYPTOPP_ARM_NEON_AVAILABLE 1 # endif #endif -// Don't include when using Apple Clang. Early Apple compilers -// fail to compile with included. Later Apple compilers compile -// intrinsics without included. Also avoid it with GCC 4.8, -// and avoid it on Android, too. -#if !defined(CRYPTOPP_APPLE_CLANG_VERSION) && \ - (!defined(CRYPTOPP_GCC_VERSION) || (CRYPTOPP_GCC_VERSION >= 40900)) && \ - !defined(__ANDROID__) -# define CRYPTOPP_ARM_ACLE_AVAILABLE 1 -#endif - // Requires ARMv8 and ACLE 2.0. GCC requires 4.8 and above. // LLVM Clang requires 3.5. Apple Clang is unknown at the moment. // Microsoft plans to support ARM-64, but its not clear how to detect it. @@ -613,6 +603,16 @@ NAMESPACE_END # endif #endif +// Don't include when using Apple Clang. Early Apple compilers +// fail to compile with included. Later Apple compilers compile +// intrinsics without included. Also avoid it with GCC 4.8, +// and avoid it on Android, too. +#if defined(CRYPTOPP_ARM_NEON_AVAILABLE) || defined(CRYPTOPP_ARM_CRC32_AVAILABLE) || \ + defined(CRYPTOPP_ARM_AES_AVAILABLE) || defined(CRYPTOPP_ARM_PMULL_AVAILABLE) || \ + defined(CRYPTOPP_ARM_SHA_AVAILABLE) +# define CRYPTOPP_ARM_ACLE_AVAILABLE 1 +#endif + #endif // ARM32, ARM64 // ***************** AltiVec and Power8 ********************