All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/2] x86/asm/bitops: optimize fls functions for constant expressions
@ 2022-11-06  9:51 Vincent Mailhol
  2022-11-06  9:51 ` [PATCH v1 1/2] x86/asm/bitops: Replace __fls() by its generic builtin implementation Vincent Mailhol
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Vincent Mailhol @ 2022-11-06  9:51 UTC (permalink / raw)
  To: x86, Ingo Molnar, Borislav Petkov
  Cc: Nick Desaulniers, Thomas Gleixner, linux-kernel, Yury Norov,
	llvm, Vincent Mailhol

The compilers provide some builtin expression equivalent to the fls(),
__fls() and fls64() functions of the kernel.

The kernel's x86 implementation relies on assembly code. This assembly
code can not be folded when used with constant expressions.

This series replaces the kernel assembly by a builtin equivalent when
appropriate. It is a follow-up on this previous series:

  https://lore.kernel.org/all/20220907090935.919-1-mailhol.vincent@wanadoo.fr/

in which I promised to also modify the fls() functions.

Vincent Mailhol (2):
  x86/asm/bitops: Replace __fls() by its generic builtin implementation
  x86/asm/bitops: Use __builtin_clz*() to evaluate constant expressions

 arch/x86/include/asm/bitops.h | 71 ++++++++++++++++++++---------------
 1 file changed, 41 insertions(+), 30 deletions(-)

-- 
2.37.4


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-11-25  2:33 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-06  9:51 [PATCH v1 0/2] x86/asm/bitops: optimize fls functions for constant expressions Vincent Mailhol
2022-11-06  9:51 ` [PATCH v1 1/2] x86/asm/bitops: Replace __fls() by its generic builtin implementation Vincent Mailhol
2022-11-07  9:38   ` Peter Zijlstra
2022-11-07 12:19     ` Vincent MAILHOL
2022-11-10 19:20     ` Nick Desaulniers
2022-11-10 19:06   ` Nick Desaulniers
2022-11-06  9:51 ` [PATCH v1 2/2] x86/asm/bitops: Use __builtin_clz*() to evaluate constant expressions Vincent Mailhol
2022-11-10 19:01   ` Nick Desaulniers
2022-11-11  1:57     ` Vincent MAILHOL
2022-11-11  3:36       ` Yury Norov
2022-11-11  7:02         ` Vincent MAILHOL
2022-11-25  2:33 ` [PATCH v2 0/2] x86/asm/bitops: optimize fls functions for " Vincent Mailhol
2022-11-25  2:33   ` [PATCH v2 1/2] x86/asm/bitops: Replace __fls() by its generic builtin implementation Vincent Mailhol
2022-11-25  2:33   ` [PATCH v2 2/2] x86/asm/bitops: Use __builtin_clz*() to evaluate constant expressions Vincent Mailhol

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.