From 2dae4b3ef609865f0b19b39cc4d44995af3d4833 Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Wed, 30 Nov 2022 12:07:36 +0000 Subject: [PATCH] Support armcc builtin byteswap routine Signed-off-by: Dave Rodgman --- library/alignment.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/alignment.h b/library/alignment.h index 86e78217b..3c5fa2360 100644 --- a/library/alignment.h +++ b/library/alignment.h @@ -158,6 +158,11 @@ inline void mbedtls_put_unaligned_uint64( void *p, uint64_t x ) #define MBEDTLS_BSWAP64 _byteswap_uint64 #endif /* defined(_MSC_VER) */ +/* Detect armcc built-in byteswap routine */ +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 410000) +#define MBEDTLS_BSWAP32 __rev +#endif + /* * Where compiler built-ins are not present, fall back to C code that the * compiler may be able to detect and transform into the relevant bswap or