[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] bitops/32: Convert variable_ffs() and fls() zero-case handling to C



On April 29, 2025 1:12:48 PM PDT, Linus Torvalds 
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>On Tue, 29 Apr 2025 at 12:13, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
>>
>> That would improve code generation for 32bit, but generally regress 64bit.
>>
>> Preloading the destination register with -1 is better than the CMOV form
>> emitted by the builtin; BSF's habit of conditionally not writing the
>> destination register *is* a CMOV of sorts.
>
>Right you are. So we'd need to do this just for the x86-32 case. Oh
>well. Ugly, but still prettier than what we have now, I guess.
>
>         Linus

Could you file a gcc bug? Gcc shouldn't generate worse code than inline asm ...



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.