Add guards for arm_neon.h

See: https://arm-software.github.io/acle/main/acle.html#arm_neonh



Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
Jerry Yu 2023-05-04 16:30:21 +08:00
parent c37e260dc5
commit 6b00f5a135
3 changed files with 16 additions and 2 deletions

View File

@ -66,7 +66,11 @@
# endif
#endif
#ifdef __ARM_NEON
#include <arm_neon.h>
#else
#error "Target does not support NEON instructions"
#endif
#if !(defined(__ARM_FEATURE_CRYPTO) || defined(__ARM_FEATURE_AES)) || \
defined(MBEDTLS_ENABLE_ARM_CRYPTO_EXTENSIONS_COMPILER_FLAG)

View File

@ -62,7 +62,13 @@
defined(MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY)
/* *INDENT-OFF* */
# include <arm_neon.h>
# ifdef __ARM_NEON
# include <arm_neon.h>
# else
# error "Target does not support NEON instructions"
# endif
# if !defined(__ARM_FEATURE_CRYPTO) || defined(MBEDTLS_ENABLE_ARM_CRYPTO_EXTENSIONS_COMPILER_FLAG)
# if defined(__clang__)
# if __clang_major__ < 4

View File

@ -60,7 +60,11 @@
# if defined(MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT) || \
defined(MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY)
/* *INDENT-OFF* */
# include <arm_neon.h>
# ifdef __ARM_NEON
# include <arm_neon.h>
# else
# error "Target does not support NEON instructions"
# endif
/*
* Best performance comes from most recent compilers, with intrinsics and -O3.
* Must compile with -march=armv8.2-a+sha3, but we can't detect armv8.2-a, and