Re: [PATCH 1/4] bitops: Add single_bit_set()
From: Geert Uytterhoeven
Date: Tue Nov 23 2021 - 04:11:05 EST
Hi Andy,
On Tue, Nov 23, 2021 at 10:04 AM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> Be sure you get better assembly in these cases. As I have told already,
> hweight() is a single assembly instruction, I'm not sure open coded variant
... on a select set of architectures.
Do we need CONFIG_HAVE_FAST_HWEIGHT?
> may be better even for long bitmaps. That said, assembly comparison and
> some performance tests would be nice to have.
> As an API per se it might make sense to have such, but you know that we don't
> add it without users.
Indeed. And code for unused APIs increase kernel size, too
(without LTO).
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds