Thread (28 messages) 28 messages, 10 authors, 2025-10-19

Re: [PATCH 05/17] powerpc: Add __attribute_const__ to ffs()-family implementations

From: Segher Boessenkool <hidden>
Date: 2025-08-15 16:42:12
Also in: linux-alpha, linux-arch, linux-hardening, linux-m68k, linux-mips, linux-riscv, linux-s390, linux-sh, lkml, llvm, sparclinux

On Fri, Aug 15, 2025 at 11:34:56AM -0500, Segher Boessenkool wrote:
On Thu, Aug 07, 2025 at 03:16:35PM +0530, Madhavan Srinivasan wrote:
quoted
making them eligible for compiler optimization.
You can instead use GCC for this.  __builtin_ffs () exists since 2003,
Erm, 1992 actually, but stuff has moved around since then :-)
and has this attribute built-in, as well as tens of other optimisations
that the kernel thing misses.

Of course using existing stuff instead of cobbling together something
half working prevents you from having a lot of fun ;-)

Segher
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help