Skip to content

powerpc: Replace some bitops functions by builtin/generic ones

Christophe Leroy linuxppc-dev lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4powerpc: Discard ffs()/__ffs() function and use builtin functions insteadarch/powerpc/include/asm/bitops.h+2 -141 reply
2/4powerpc: Use builtin functions for fls()/__fls()/fls64()arch/powerpc/include/asm/bitops.h+3 -210 replies
3/4powerpc: Replace ffz() by equivalent generic functionarch/powerpc/include/asm/bitops.h+1 -190 replies
4/4powerpc: remove __ilog2()s and use generic onesarch/powerpc/Kconfig arch/powerpc/include/asm/bitops.h+1 -340 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] powerpc: Replace some bitops functions by builtin/generic ones

This patchset replaces the following bitops by builtin/generic ones:
- ffs() / __ffs()
- fls() / __fls() / fls64()
- ffz()
- __ilog2() / __ilog2_u32() / __ilog2_u64()

The current functions are written as inline assembly which prevents GCC to optimise them in case of constant parameters and obliges GCC to group the related instructions all together.

With the builtin alternatives, GCC optimises better

Christophe Leroy (4):
powerpc: Discard ffs()/__ffs() function and use builtin functions
instead
powerpc: Use builtin functions for fls()/__fls()/fls64()
powerpc: Replace ffz() by equivalent generic function
powerpc: remove __ilog2()s and use generic ones

 arch/powerpc/Kconfig              |  8 ----
 arch/powerpc/include/asm/bitops.h | 87 ++++-----------------------------------
 2 files changed, 7 insertions(+), 88 deletions(-)
Signature · 1 line
2.12.0