Guard <arm_acle.h> include for GCC 4.8

Use system includes for <arm_neon.h> and <arm_acle.h>
This commit is contained in:
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 "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

View File

@ -31,19 +31,20 @@
#endif
#if (CRYPTOPP_CLMUL_AVAILABLE)
# include "tmmintrin.h"
# include "wmmintrin.h"
# include <tmmintrin.h>
# include <wmmintrin.h>
#endif
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
# include "arm_neon.h"
# 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_PMULL_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_PMULL_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

View File

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

View File

@ -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

View File

@ -23,19 +23,20 @@
#endif
#if (CRYPTOPP_SHANI_AVAILABLE)
# include "nmmintrin.h"
# include "immintrin.h"
# include <nmmintrin.h>
# include <immintrin.h>
#endif
#if (CRYPTOPP_ARM_SHA_AVAILABLE)
# include "arm_neon.h"
# 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
// Clang __m128i casts, http://bugs.llvm.org/show_bug.cgi?id=20670