On 24.05.2024 22:03, Andrew Cooper wrote: > Perform constant-folding unconditionally, rather than having it implemented > inconsistency between architectures. > > Confirm the expected behaviour with compile time and boot time tests. > > For non-constant inputs, use arch_ffs() if provided but fall back to > generic_ffsl() if not. In particular, RISC-V doesn't have a builtin that > works in all configurations. > > For x86, rename ffs() to arch_ffs() and adjust the prototype. > > For PPC, __builtin_ctz() is 1/3 of the size of size of the transform to > generic_fls(). Drop the definition entirely. ARM too benefits in the general > case by using __builtin_ctz(), but less dramatically because it using > optimised asm(). > > Signed-off-by: Andrew Cooper <[email protected]>
Reviewed-by: Jan Beulich <[email protected]>
