lkml.org 
[lkml]   [2022]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH v1 0/2] x86/asm/bitops: optimize fls functions for constant expressions
Date
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

\
 
 \ /
  Last update: 2022-11-06 10:52    [W:0.131 / U:1.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site