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

Re: [Xen-devel] [PATCH 2/2] arm64: fix fls()

>>> On 22.01.15 at 15:01, <tim@xxxxxxx> wrote:
> At 13:38 +0000 on 22 Jan (1421930334), Jan Beulich wrote:
>> It using CLZ on a 64-bit register while specifying the input operand as
>> only 32 bits wide is wrong: An operand intentionally shrunk down to 32
>> bits at the source level doesn't imply respective zero extension also
>> happens at the machine instruction level, and hence the wrong result
>> could get returned.
>> Add suitable inline assembly abstraction so that the function can
>> remain shared between arm32 and arm64.
> Would casting the asm arguments to unsigned long DTRT withuot
> needing #ifdefs?

The input one - yes, I think so. But it wouldn't be me to introduce
such (suspicious) casts, and I also think it is better to use 32-bit
instruction variants where possible (which quite certainly won't
perform worse than the 64-bit ones, but may perform better).


Xen-devel mailing list



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