1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Tidy-up macros and fix guards around option B

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
Dave Rodgman
2023-05-24 18:28:46 +01:00
parent 1416cba81f
commit ffbb7c5edc

View File

@ -671,10 +671,11 @@
* clang and armcc5 under the same conditions). * clang and armcc5 under the same conditions).
*/ */
#if defined(__ARM_ARCH) //#if defined(__ARM_ARCH)
#if __ARM_ARCH >= 6 //#if __ARM_ARCH >= 6
#if defined(__thumb__) && !defined(__thumb2__) // Thumb1 (not Thumb 2) ISA #if defined(__thumb__) && !defined(__thumb2__) // Thumb1 (not Thumb 2) ISA
// Only supported by gcc, when optimisation is enabled; only option A works // Only supported by gcc, when optimisation is enabled; only option A works
#if defined(__OPTIMIZE__) && !defined(__ARMCC_VERSION) #if defined(__OPTIMIZE__) && !defined(__ARMCC_VERSION)
#define ARM_OPTION_A #define ARM_OPTION_A
@ -683,25 +684,32 @@
#elif defined(__thumb2__) // Thumb 2 ISA #elif defined(__thumb2__) // Thumb 2 ISA
#if !defined(__ARMCC_VERSION) && !defined(__OPTIMIZE__) #if !defined(__ARMCC_VERSION) && !defined(__OPTIMIZE__)
// gcc -O0 // gcc -O0: only option B builds
// only option B builds #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1)
#define ARM_OPTION_B #define ARM_OPTION_B
#elif !defined(__ARMCC_VERSION) #endif
// gcc with optimisation - any option builds
#define ARM_OPTION_A
#else #else
// armclang // gcc with optimisation, or armclang: any option builds
// options A or C build #define ARM_OPTION_B_OR_C
#define ARM_OPTION_A
#endif #endif
#elif defined(__arm__) // Arm ISA #elif defined(__arm__) // Arm ISA
// any option builds. A does not seem to work; B is about 2x faster than C (under emulation). // any option builds. A does not seem to work; B is about 2x faster than C (under emulation).
#define ARM_OPTION_B #define ARM_OPTION_B_OR_C
#endif
#endif #endif
#if defined(ARM_OPTION_B_OR_C)
#if (__ARM_ARCH >= 6) && defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1)
#define ARM_OPTION_B
#else
#define ARM_OPTION_C
#endif #endif
#endif
//#endif
//#endif
#if defined(ARM_OPTION_A) #if defined(ARM_OPTION_A)