Re: [PATCH 18/24] C6X: headers

Mark Salter
2011-08-23T13:43:21Z

On Mon, 2011-08-22 at 23:14 +0200, Arnd Bergmann wrote:
> On Monday 22 August 2011 16:09:39 Mark Salter wrote:
> > Signed-off-by: Mark Salter <msalter@redhat.com>
>
> >
> > diff --git a/arch/c6x/include/asm/asm-offsets.h b/arch/c6x/include/asm/asm-offsets.h
> > new file mode 100644
> > index 0000000..d370ee3
> > --- /dev/null
> > +++ b/arch/c6x/include/asm/asm-offsets.h
> > @@ -0,0 +1 @@
> > +#include <generated/asm-offsets.h>
>
> I wonder if it makes sense to install this file in asm-generic/asm-offsets.h
> and referencing it like the other files.

I think so. It is the same for all arches.

>
> > +#include <asm-generic/bitops/hweight.h>
>
> Do you have an instruction that can be used for hweight? That is often a useful
> optimization.

Hmm, there is a bit count instruction, but it counts bits within octets
of a 32 bit register, so it ends with 4 sums that would need shifting
and adding. Even so, a little asm here would be a good optimization. All
of the bitops need a look for such optimizations because of how well
DSPs support bit manipulations.

--Mark