mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-01-29 21:33:02 +00:00
Refactor preprocessing for arm none
Signed-off-by: Agathiyan Bragadeesh <agathiyan.bragadeesh2@arm.com>
This commit is contained in:
parent
271a95331e
commit
e55a1e1cf4
@ -35,21 +35,18 @@
|
||||
|
||||
size_t mbedtls_mpi_core_clz(mbedtls_mpi_uint a)
|
||||
{
|
||||
|
||||
|
||||
#if defined(__has_builtin)
|
||||
#if (MBEDTLS_MPI_UINT_MAX == UINT_MAX)
|
||||
#if __has_builtin(__builtin_clz)
|
||||
return (size_t) __builtin_clz(a);
|
||||
#endif
|
||||
#elif (MBEDTLS_MPI_UINT_MAX == ULONG_MAX)
|
||||
#if __has_builtin(__builtin_clzl)
|
||||
return (size_t) __builtin_clzl(a);
|
||||
#endif
|
||||
#elif (MBEDTLS_MPI_UINT_MAX == ULLONG_MAX)
|
||||
#if __has_builtin(__builtin_clzll)
|
||||
return (size_t) __builtin_clzll(a);
|
||||
#if (MBEDTLS_MPI_UINT_MAX == UINT_MAX) && __has_builtin(__builtin_clz)
|
||||
#define core_clz __builtin_clz
|
||||
#elif (MBEDTLS_MPI_UINT_MAX == ULONG_MAX) && __has_builtin(__builtin_clzl)
|
||||
#define core_clz __builtin_clzl
|
||||
#elif (MBEDTLS_MPI_UINT_MAX == ULLONG_MAX) && __has_builtin(__builtin_clzll)
|
||||
#define core_clz __builtin_clzll
|
||||
#endif
|
||||
#endif
|
||||
#if defined(core_clz)
|
||||
return (size_t) core_clz(a);
|
||||
#else
|
||||
size_t j;
|
||||
mbedtls_mpi_uint mask = (mbedtls_mpi_uint) 1 << (biL - 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user