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,37 +671,45 @@
* 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
#if defined(__OPTIMIZE__) && !defined(__ARMCC_VERSION) // Only supported by gcc, when optimisation is enabled; only option A works
#define ARM_OPTION_A #if defined(__OPTIMIZE__) && !defined(__ARMCC_VERSION)
#endif #define ARM_OPTION_A
#endif
#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 #else
#define ARM_OPTION_A // gcc with optimisation, or armclang: any option builds
#else #define ARM_OPTION_B_OR_C
// armclang #endif
// options A or C build
#define ARM_OPTION_A
#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).
#define ARM_OPTION_B // any option builds. A does not seem to work; B is about 2x faster than C (under emulation).
#endif #define ARM_OPTION_B_OR_C
#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)