On Mon, 28 Apr 2025 at 19:00, H. Peter Anvin <h...@zytor.com> wrote:
>
> Now, question: can we just use __builtin_*() for these? I think gcc should 
> always generate inline code for these on x86.

Yeah, I think we can just use __builtin_ffs() directly and get rid of
all the games.

Not all gcc builtins are great: I did a bugzilla about gcc ctzl some time ago:

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106471

but for ffs() that does sound like it's the simplest thing to do.

               Linus

Reply via email to