Guard <arm_acle.h> include for GCC 4.8

Use system includes for <arm_neon.h> and <arm_acle.h>
pull/507/head
Jeffrey Walton 2017-09-12 05:29:51 -04:00
parent 81a272b046
commit 17bf824790
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
5 changed files with 38 additions and 28 deletions

View File

@ -10,20 +10,26 @@
#include "config.h" #include "config.h"
#include "misc.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)) #if !(defined(__ARM_FEATURE_CRC32) || defined(_MSC_VER))
# undef CRYPTOPP_ARM_CRC32_AVAILABLE # undef CRYPTOPP_ARM_CRC32_AVAILABLE
#endif #endif
#if (CRYPTOPP_SSE42_AVAILABLE) #if (CRYPTOPP_CLMUL_AVAILABLE)
# include "nmmintrin.h" # include <nmmintrin.h>
#endif
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
# include <arm_neon.h>
#endif #endif
// Don't include <arm_acle.h> when using Apple Clang. Early Apple compilers // 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 // fail to compile with <arm_acle.h> included. Later Apple compilers compile
// intrinsics without <arm_acle.h> included. // intrinsics without <arm_acle.h> included. Also avoid it with GCC 4.8.
#if (CRYPTOPP_ARM_CRC32_AVAILABLE) && !defined(CRYPTOPP_APPLE_CLANG_VERSION) #if (CRYPTOPP_ARM_CRC32_AVAILABLE) && !defined(CRYPTOPP_APPLE_CLANG_VERSION) && \
# include "arm_acle.h" (!defined(CRYPTOPP_GCC_VERSION) || (CRYPTOPP_GCC_VERSION >= 40900))
# include <arm_acle.h>
#endif #endif
#ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY #ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY

View File

@ -31,19 +31,20 @@
#endif #endif
#if (CRYPTOPP_CLMUL_AVAILABLE) #if (CRYPTOPP_CLMUL_AVAILABLE)
# include "tmmintrin.h" # include <tmmintrin.h>
# include "wmmintrin.h" # include <wmmintrin.h>
#endif #endif
#if (CRYPTOPP_ARM_NEON_AVAILABLE) #if (CRYPTOPP_ARM_NEON_AVAILABLE)
# include "arm_neon.h" # include <arm_neon.h>
#endif #endif
// Don't include <arm_acle.h> when using Apple Clang. Early Apple compilers // 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 // fail to compile with <arm_acle.h> included. Later Apple compilers compile
// intrinsics without <arm_acle.h> included. // intrinsics without <arm_acle.h> included. Also avoid it with GCC 4.8.
#if (CRYPTOPP_ARM_PMULL_AVAILABLE) && !defined(CRYPTOPP_APPLE_CLANG_VERSION) #if (CRYPTOPP_ARM_PMULL_AVAILABLE) && !defined(CRYPTOPP_APPLE_CLANG_VERSION) && \
# include "arm_acle.h" (!defined(CRYPTOPP_GCC_VERSION) || (CRYPTOPP_GCC_VERSION >= 40900))
# include <arm_acle.h>
#endif #endif
#ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY #ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY

View File

@ -11,7 +11,7 @@
#include "stdcpp.h" #include "stdcpp.h"
#if (CRYPTOPP_ARM_NEON_AVAILABLE) #if (CRYPTOPP_ARM_NEON_AVAILABLE)
# include "arm_neon.h" # include <arm_neon.h>
#endif #endif
#ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY #ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY

View File

@ -11,25 +11,27 @@
#include "sha.h" #include "sha.h"
#include "misc.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)) #if !(defined(__ARM_FEATURE_CRYPTO) || defined(_MSC_VER))
# undef CRYPTOPP_ARM_SHA_AVAILABLE # undef CRYPTOPP_ARM_SHA_AVAILABLE
#endif #endif
#if (CRYPTOPP_SHANI_AVAILABLE) #if (CRYPTOPP_CLMUL_AVAILABLE)
# include "nmmintrin.h" # include <nmmintrin.h>
# include "immintrin.h" # include <immintrin.h>
#endif #endif
#if (CRYPTOPP_ARM_SHA_AVAILABLE) #if (CRYPTOPP_ARM_NEON_AVAILABLE)
# include "arm_neon.h" # include <arm_neon.h>
#endif #endif
// Don't include <arm_acle.h> when using Apple Clang. Early Apple compilers // 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 // fail to compile with <arm_acle.h> included. Later Apple compilers compile
// intrinsics without <arm_acle.h> included. // intrinsics without <arm_acle.h> included. Also avoid it with GCC 4.8.
#if (CRYPTOPP_ARM_SHA_AVAILABLE) && !defined(CRYPTOPP_APPLE_CLANG_VERSION) #if (CRYPTOPP_ARM_SHA_AVAILABLE) && !defined(CRYPTOPP_APPLE_CLANG_VERSION) && \
# include "arm_acle.h" (!defined(CRYPTOPP_GCC_VERSION) || (CRYPTOPP_GCC_VERSION >= 40900))
# include <arm_acle.h>
#endif #endif
#ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY #ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY

View File

@ -23,19 +23,20 @@
#endif #endif
#if (CRYPTOPP_SHANI_AVAILABLE) #if (CRYPTOPP_SHANI_AVAILABLE)
# include "nmmintrin.h" # include <nmmintrin.h>
# include "immintrin.h" # include <immintrin.h>
#endif #endif
#if (CRYPTOPP_ARM_SHA_AVAILABLE) #if (CRYPTOPP_ARM_SHA_AVAILABLE)
# include "arm_neon.h" # include <arm_neon.h>
#endif #endif
// Don't include <arm_acle.h> when using Apple Clang. Early Apple compilers // 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 // fail to compile with <arm_acle.h> included. Later Apple compilers compile
// intrinsics without <arm_acle.h> included. // intrinsics without <arm_acle.h> included. Also avoid it with GCC 4.8.
#if (CRYPTOPP_ARM_SHA_AVAILABLE) && !defined(CRYPTOPP_APPLE_CLANG_VERSION) #if (CRYPTOPP_ARM_SHA_AVAILABLE) && !defined(CRYPTOPP_APPLE_CLANG_VERSION) && \
# include "arm_acle.h" (!defined(CRYPTOPP_GCC_VERSION) || (CRYPTOPP_GCC_VERSION >= 40900))
# include <arm_acle.h>
#endif #endif
// Clang __m128i casts, http://bugs.llvm.org/show_bug.cgi?id=20670 // Clang __m128i casts, http://bugs.llvm.org/show_bug.cgi?id=20670