Re: [PATCH 05/17] powerpc: Add __attribute_const__ to ffs()-family implementations
Segher Boessenkool <[email protected]>
| Newsgroups | org.kernel.vger.linux-hexagon,dev.linux.lists.llvm,org.infradead.lists.linux-riscv,org.kernel.vger.linux-alpha,org.kernel.vger.linux-arch,org.kernel.vger.linux-csky,org.kernel.vger.linux-hardening,org.kernel.vger.linux-kernel,org.kernel.vger.linux-m68k,org.kernel.vger.linux-mips,org.kernel.vger.linux-openrisc,org.kernel.vger.linux-parisc,org.kernel.vger.linux-s390,org.kernel.vger.linux-sh,org.kernel.vger.sparclinux,org.ozlabs.lists.linuxppc-dev |
|---|---|
| Message-ID | <aJ9jV80oYG6rPN1o@gate> |
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: > > 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