>>> On 29.01.15 at 09:20, wrote:
> On Wed, Jan 28, 2015 at 11:54 PM, Jan Beulich wrote:
>> Hello,
>>
>> in the Xen project we had (meanwhile fixed) code like this (meant to
>> be uniform between 32- and 64-bit):
>>
>> static inline int fls(unsigned int x) {
>> int ret;
>> asm("clz
On Wed, Jan 28, 2015 at 11:54 PM, Jan Beulich wrote:
> Hello,
>
> in the Xen project we had (meanwhile fixed) code like this (meant to
> be uniform between 32- and 64-bit):
>
> static inline int fls(unsigned int x) {
> int ret;
> asm("clz\t%0, %1" : "=r" (ret) : "r" (x));
>
Hello,
in the Xen project we had (meanwhile fixed) code like this (meant to
be uniform between 32- and 64-bit):
static inline int fls(unsigned int x) {
int ret;
asm("clz\t%0, %1" : "=r" (ret) : "r" (x));
return BITS_PER_LONG - ret;
}
Being mainly an x86 person, when I fir