[PATCH] powerpc: emulate power5 popcntb instruction

Segher Boessenkool segher at kernel.crashing.org
Tue Aug 29 16:43:38 EST 2006


>> I just did a patch to fix the existing masks.

Thanks Paul.

>> Could you do a new
>> version of this patch that doesn't include the unrelated mask fixes
>> please?  Also it would be really nice if you could figure out a  
>> way to
>> avoid doing the unnecessary 64-bit logical operations on 32-bit
>> machines - i.e. using an unsigned long for tmp, but then the  
>> constants
>> become problematic.  Maybe you need something like
>>
>> #define LCONST(x)	((unsigned long)(x##ULL))
>
> Ok, how about this..

Hrm.  The LCONST() thing is butt ugly though; you can just write
0x3333333333333333ULL etc. and GCC will do the right thing (i.e.
efficient code), and not warn (don't need the "ULL" even when in
C99/gnu99 mode, as we should be but aren't, heh).

You want to make tmp and unsigned long instead of an u64...


Segher




More information about the Linuxppc-dev mailing list