Re: Alternative implementation of the generic __ffs

From: Mikael Pettersson
Date: Sat Apr 19 2008 - 06:06:08 EST


dean gaudet writes:
> On Fri, 18 Apr 2008, Joe Perches wrote:
>
> > On Fri, 2008-04-18 at 18:11 -0700, dean gaudet wrote:
> > > have you benchmarked it?
> >
> > I modified Alexander's benchmark:
> > http://lkml.org/lkml/2008/4/18/267
> > to include 32 and 64 bit variants called smallest.
> >
> > On an old ARM:
>
> i'm guessing the 32-bit constants suck :(
>
> the code could be modified to use 16-bit constants only

16-bit immediates don't help, as ARMs express immediate
operands in arithmetic instructions as 8-bit values plus
a 4-bit rotation count (which is multiplied by 2).

Very new ARMs can construct full 16-bit immediates, but
that still takes an additional instruction and an additional
register.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/