mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-24 06:02:44 +00:00
Use MBEDTLS_HAVE_NEON_INTRINSICS instead of __ARM_NEON
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
parent
4ffd7c7614
commit
a0f10da9d2
@ -26,7 +26,7 @@
|
|||||||
* By defining the macros ourselves we gain access to those declarations without
|
* By defining the macros ourselves we gain access to those declarations without
|
||||||
* requiring -march on the command line.
|
* requiring -march on the command line.
|
||||||
*
|
*
|
||||||
* `arm_neon.h` could be included by any header file, so we put these defines
|
* `arm_neon.h` is included by common.h, so we put these defines
|
||||||
* at the top of this file, before any includes.
|
* at the top of this file, before any includes.
|
||||||
*/
|
*/
|
||||||
#define __ARM_FEATURE_CRYPTO 1
|
#define __ARM_FEATURE_CRYPTO 1
|
||||||
@ -66,9 +66,7 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __ARM_NEON
|
#if !defined(MBEDTLS_HAVE_NEON_INTRINSICS)
|
||||||
#include <arm_neon.h>
|
|
||||||
#else
|
|
||||||
#error "Target does not support NEON instructions"
|
#error "Target does not support NEON instructions"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ inline void mbedtls_xor(unsigned char *r, const unsigned char *a, const unsigned
|
|||||||
{
|
{
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
#if defined(MBEDTLS_EFFICIENT_UNALIGNED_ACCESS)
|
#if defined(MBEDTLS_EFFICIENT_UNALIGNED_ACCESS)
|
||||||
#if defined(__ARM_NEON)
|
#if defined(MBEDTLS_HAVE_NEON_INTRINSICS)
|
||||||
for (; (i + 16) <= n; i += 16) {
|
for (; (i + 16) <= n; i += 16) {
|
||||||
uint8x16_t v1 = vld1q_u8(a + i);
|
uint8x16_t v1 = vld1q_u8(a + i);
|
||||||
uint8x16_t v2 = vld1q_u8(b + i);
|
uint8x16_t v2 = vld1q_u8(b + i);
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
* By defining the macros ourselves we gain access to those declarations without
|
* By defining the macros ourselves we gain access to those declarations without
|
||||||
* requiring -march on the command line.
|
* requiring -march on the command line.
|
||||||
*
|
*
|
||||||
* `arm_neon.h` could be included by any header file, so we put these defines
|
* `arm_neon.h` is included by common.h, so we put these defines
|
||||||
* at the top of this file, before any includes.
|
* at the top of this file, before any includes.
|
||||||
*/
|
*/
|
||||||
#define __ARM_FEATURE_CRYPTO 1
|
#define __ARM_FEATURE_CRYPTO 1
|
||||||
@ -63,9 +63,7 @@
|
|||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
|
|
||||||
# ifdef __ARM_NEON
|
# if !defined(MBEDTLS_HAVE_NEON_INTRINSICS)
|
||||||
# include <arm_neon.h>
|
|
||||||
# else
|
|
||||||
# error "Target does not support NEON instructions"
|
# error "Target does not support NEON instructions"
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
@ -110,12 +108,7 @@
|
|||||||
# include <signal.h>
|
# include <signal.h>
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#elif defined(_M_ARM64) || defined(_M_ARM64EC)
|
#elif !(defined(_M_ARM64) || defined(_M_ARM64EC))
|
||||||
# if defined(MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT) || \
|
|
||||||
defined(MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY)
|
|
||||||
# include <arm64_neon.h>
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
# undef MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY
|
# undef MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY
|
||||||
# undef MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT
|
# undef MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT
|
||||||
#endif
|
#endif
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
* By defining the macros ourselves we gain access to those declarations without
|
* By defining the macros ourselves we gain access to those declarations without
|
||||||
* requiring -march on the command line.
|
* requiring -march on the command line.
|
||||||
*
|
*
|
||||||
* `arm_neon.h` could be included by any header file, so we put these defines
|
* `arm_neon.h` is included by common.h, so we put these defines
|
||||||
* at the top of this file, before any includes.
|
* at the top of this file, before any includes.
|
||||||
*/
|
*/
|
||||||
#define __ARM_FEATURE_SHA512 1
|
#define __ARM_FEATURE_SHA512 1
|
||||||
@ -60,9 +60,7 @@
|
|||||||
# if defined(MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT) || \
|
# if defined(MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT) || \
|
||||||
defined(MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY)
|
defined(MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY)
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
# ifdef __ARM_NEON
|
# if !defined(MBEDTLS_HAVE_NEON_INTRINSICS)
|
||||||
# include <arm_neon.h>
|
|
||||||
# else
|
|
||||||
# error "Target does not support NEON instructions"
|
# error "Target does not support NEON instructions"
|
||||||
# endif
|
# endif
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user