[PATCH v2] x86_64: Optimize ffsll function code size.
Cristian Rodríguez
cristian@rodriguez.im
Tue Aug 1 18:25:02 GMT 2023
On Tue, Aug 1, 2023 at 9:47 AM Adhemerval Zanella Netto via Libc-alpha <
libc-alpha@sourceware.org> wrote:
>
>
> On 31/07/23 20:44, Sunil Pandey wrote:
>
> On my system, ffssl is only used by a single program
> (/usr/bin/nvidia-persistenced)
> which I am not sure how it is compile because it a closed source one.
it is probably built with some strict-standard setting.. -ansi or whatever.
> The ffs is
> used by a couple more (gdb, lvm, and some mesa drivers), but again far
> from being
> a hotspot.
>
> https://cgit.freedesktop.org/drm/libdrm/tree/meson.build#n27 --> built
with std=c11 instead of gnu11 therefore not benefiting from the compiler's
use of builtins..
And as Andreas have said, the best course of action here is to fix the
> compiler
> if it is not generating code enough code. Fixing gcc means that we will
> get
> any optimization by free (by using the builtin) and any code that actually
> uses
> ffs/ffsl/ffsll.
>
I agree. the compiler already does this, if done suboptimally the ball is
on GCC to fix it.
More information about the Libc-alpha
mailing list