Re: [PATCH 1/5] ARM: findbit: document ARMv5 bit offset calculation
From: Linus Torvalds
Date: Fri Oct 28 2022 - 13:08:57 EST
On Fri, Oct 28, 2022 at 9:47 AM Russell King (Oracle)
<rmk+kernel@xxxxxxxxxxxxxxx> wrote:
>
> Document the ARMv5 bit offset calculation code.
Hmm. Don't the generic bitop functions end up using this? We do have a
comment in the code that says
* On ARMv5 and above, the gcc built-ins may rely on the clz instruction
* and produce optimal inlined code in all cases. On ARMv7 it is even
* better by also using the rbit instruction.
but that 'may' makes me wonder...
IOW, what is it in the hand-written code that doesn't get done by the
generic code these days?
Linus