Re: [PATCH 10/31] Add sparc-specific parity functions

2016-03-28 Thread David Miller
From: Sam Ravnborg Date: Mon, 28 Mar 2016 17:37:43 +0200 > If popc is availble then use of hweight* should be fine. > But without popc then I think the generic implementation that > uses the stanford algorithm would be most efficient, > rather than the base this on the generic hweight functions.

Re: [PATCH 10/31] Add sparc-specific parity functions

2016-03-28 Thread Sam Ravnborg
On Mon, Mar 28, 2016 at 11:29:15AM -0400, David Miller wrote: > From: Zeng Zhaoxiu > Date: Mon, 28 Mar 2016 13:44:03 +0800 > > > 在 2016年03月28日 10:43, David Miller 写道: > >> From: "zhaoxiu.zeng" > >> Date: Sun, 27 Mar 2016 14:43:10 +0800 > >> > >>> + > >>> +/* > >>> + * parityN: returns the parity

Re: [PATCH 10/31] Add sparc-specific parity functions

2016-03-28 Thread David Miller
From: Zeng Zhaoxiu Date: Mon, 28 Mar 2016 13:44:03 +0800 > 在 2016年03月28日 10:43, David Miller 写道: >> From: "zhaoxiu.zeng" >> Date: Sun, 27 Mar 2016 14:43:10 +0800 >> >>> + >>> +/* >>> + * parityN: returns the parity of a N-bit word, >>> + * i.e. the number of 1-bits in x modulo 2. >>> + */ >>> +

Re: [PATCH 10/31] Add sparc-specific parity functions

2016-03-27 Thread Zeng Zhaoxiu
在 2016年03月28日 10:43, David Miller 写道: From: "zhaoxiu.zeng" Date: Sun, 27 Mar 2016 14:43:10 +0800 + +/* + * parityN: returns the parity of a N-bit word, + * i.e. the number of 1-bits in x modulo 2. + */ + +#define __arch_parity4(w) (__arch_hweight8((w) & 0xf) & 1) +#define __arch_parity8(w

Re: [PATCH 10/31] Add sparc-specific parity functions

2016-03-27 Thread David Miller
From: "zhaoxiu.zeng" Date: Sun, 27 Mar 2016 14:43:10 +0800 > + > +/* > + * parityN: returns the parity of a N-bit word, > + * i.e. the number of 1-bits in x modulo 2. > + */ > + > +#define __arch_parity4(w)(__arch_hweight8((w) & 0xf) & 1) > +#define __arch_parity8(w)(__arch_hweight8(w) &

[PATCH 10/31] Add sparc-specific parity functions

2016-03-26 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- arch/sparc/include/asm/bitops_32.h | 1 + arch/sparc/include/asm/bitops_64.h | 13 + 2 files changed, 14 insertions(+) diff --git a/arch/sparc/include/asm/bitops_32.h b/arch/sparc/include/asm/bitops_32.h index 600ed1d..8c41896 10