diff options
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/atomic_arch.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/atomic_arch.h b/arch/arm/atomic_arch.h index c5c56f81..72fcddb4 100644 --- a/arch/arm/atomic_arch.h +++ b/arch/arm/atomic_arch.h @@ -91,4 +91,16 @@ static inline int a_clz_32(uint32_t x) return x; } +#if __ARM_ARCH_6T2__ || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH >= 7 + +#define a_ctz_32 a_ctz_32 +static inline int a_ctz_32(uint32_t x) +{ + uint32_t xr; + __asm__ ("rbit %0, %1" : "=r"(xr) : "r"(x)); + return a_clz_32(xr); +} + +#endif + #endif |