Add MBEDTLS_BSWAPxx intrinsics for IAR
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
parent
f3c04f3f47
commit
650674bb41
1 changed files with 10 additions and 0 deletions
|
@ -180,6 +180,16 @@ inline void mbedtls_put_unaligned_uint64(void *p, uint64_t x)
|
||||||
#define MBEDTLS_BSWAP32 __rev
|
#define MBEDTLS_BSWAP32 __rev
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Detect IAR built-in byteswap routine */
|
||||||
|
#if defined(__IAR_SYSTEMS_ICC__)
|
||||||
|
#if defined(__ARM_ACLE)
|
||||||
|
#include <arm_acle.h>
|
||||||
|
#define MBEDTLS_BSWAP16(x) ((uint16_t) __rev16((uint32_t) (x)))
|
||||||
|
#define MBEDTLS_BSWAP32 __rev
|
||||||
|
#define MBEDTLS_BSWAP64 __revll
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Where compiler built-ins are not present, fall back to C code that the
|
* 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
|
* compiler may be able to detect and transform into the relevant bswap or
|
||||||
|
|
Loading…
Reference in a new issue