Messages in this thread | | | Date | Mon, 7 Nov 2022 10:38:59 +0100 | From | Peter Zijlstra <> | Subject | Re: [PATCH v1 1/2] x86/asm/bitops: Replace __fls() by its generic builtin implementation |
| |
On Sun, Nov 06, 2022 at 06:51:05PM +0900, Vincent Mailhol wrote: > The builtin implementation is better for two reasons: > > 1/ it saves two instructions on clang (a push and a stack pointer > decrement) because of a useless tentative to save rax.
I'm thinking this is the same old clang-sucks-at-"rm" constraints and *really* should not be a reason to change things. Clang should get fixed already.
> 2/ when used on constant expressions, the compiler is only able to > fold the builtin version (c.f. [2]). > > For those two reasons, replace the assembly implementation by its > builtin counterpart. > > [1] https://elixir.bootlin.com/linux/v6.0/source/include/asm-generic/bitops/builtin-__fls.h > > [2] commit 146034fed6ee ("x86/asm/bitops: Use __builtin_ffs() to evaluate constant expressions")
I would much prefer consistently with 146034fed6ee.
| |