On Wednesday 01 February 2006 10:02, Akinobu Mita wrote:
> +static inline unsigned int hweight32(unsigned int w)
> +{
> + unsigned int res = (w & 0x55555555) + ((w >> 1) & 0x55555555);
> + res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
> + res = (res & 0x0F0F0F0F) + ((res >> 4) & 0x0F0F0F0F);
> + res = (res & 0x00FF00FF) + ((res >> 8) & 0x00FF00FF);
> + return (res & 0x0000FFFF) + ((res >> 16) & 0x0000FFFF);
> +}
How large are these functions on x86? Maybe it would be better to not inline
them,
but put it into some C file out of line.
-Andi
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [patch 29/44] mips: use generic bitops, Akinobu Mita |
|---|---|
| Next by Date: | Re: [patch 14/44] generic hweight{64,32,16,8}(), Michael Tokarev |
| Previous by Thread: | [patch 14/44] generic hweight{64,32,16,8}(), Akinobu Mita |
| Next by Thread: | Re: [patch 14/44] generic hweight{64,32,16,8}(), Michael Tokarev |
| Indexes: | [Date] [Thread] [Top] [All Lists] |