mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-04-11 16:37:45 -04:00
arm: use optimized find_first_set_bit() on Cortex-M
Use the optimized version based on __buitlin_ctz() which GCC will compile to two instructions (rbit, ctz) on Cortex-M4/M7; faster and smaller than the handcoded assembly version. Change-Id: I33f69ff829b048f1e53fc7ead1bd6ac3c5bd7a4c
This commit is contained in:
parent
4ceb9e22d6
commit
20d31c114a
1 changed files with 2 additions and 1 deletions
|
|
@ -163,7 +163,8 @@ int get_cpu_boost_counter(void);
|
|||
#endif
|
||||
|
||||
/* returns index of first set bit or 32 if no bits are set */
|
||||
#if defined(CPU_ARM) && ARM_ARCH >= 5 && !defined(__thumb__)
|
||||
#if (defined(CPU_ARM) && ARM_ARCH >= 5 && !defined(__thumb__)) || \
|
||||
defined(CPU_ARM_MICRO)
|
||||
static inline int find_first_set_bit(uint32_t val)
|
||||
{ return LIKELY(val) ? __builtin_ctz(val) : 32; }
|
||||
#else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue