Alpha arch development list
 help / color / mirror / Atom feed
* [PATCH 03/31] Add alpha-specific parity functions
       [not found] <1458788612-4367-1-git-send-email-zhaoxiu.zeng@gmail.com>
@ 2016-03-27  5:43 ` zhaoxiu.zeng
  2016-03-28 18:33   ` Richard Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: zhaoxiu.zeng @ 2016-03-27  5:43 UTC (permalink / raw)
  To: Richard Henderson, Ivan Kokshaysky, Matt Turner, Zeng Zhaoxiu,
	linux-alpha
  Cc: linux-kernel@vger.kernel.org

From: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>

Signed-off-by: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>
---
 arch/alpha/include/asm/bitops.h | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/arch/alpha/include/asm/bitops.h b/arch/alpha/include/asm/bitops.h
index 4bdfbd4..95a43fa 100644
--- a/arch/alpha/include/asm/bitops.h
+++ b/arch/alpha/include/asm/bitops.h
@@ -421,11 +421,38 @@ static inline unsigned int __arch_hweight8(unsigned int w)
 {
 	return __arch_hweight64(w & 0xff);
 }
+
+static inline unsigned int __arch_parity64(unsigned long w)
+{
+	return (unsigned int)__kernel_ctpop(w) & 1;
+}
+
+static inline unsigned int __arch_parity32(unsigned int w)
+{
+	return __arch_parity64(w);
+}
+
+static inline unsigned int __arch_parity16(unsigned int w)
+{
+	return __arch_parity64(w & 0xffff);
+}
+
+static inline unsigned int __arch_parity8(unsigned int w)
+{
+	return __arch_parity64(w & 0xff);
+}
+
+static inline unsigned int __arch_parity4(unsigned int w)
+{
+	return __arch_parity64(w & 0xf);
+}
 #else
 #include <asm-generic/bitops/arch_hweight.h>
+#include <asm-generic/bitops/arch_parity.h>
 #endif
 
 #include <asm-generic/bitops/const_hweight.h>
+#include <asm-generic/bitops/const_parity.h>
 
 #endif /* __KERNEL__ */
 
-- 
2.5.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 03/31] Add alpha-specific parity functions
  2016-03-27  5:43 ` [PATCH 03/31] Add alpha-specific parity functions zhaoxiu.zeng
@ 2016-03-28 18:33   ` Richard Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2016-03-28 18:33 UTC (permalink / raw)
  To: zhaoxiu.zeng, Ivan Kokshaysky, Matt Turner, linux-alpha
  Cc: linux-kernel@vger.kernel.org

On 03/26/2016 10:43 PM, zhaoxiu.zeng wrote:
> From: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>
>
> Signed-off-by: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>
> ---
>   arch/alpha/include/asm/bitops.h | 27 +++++++++++++++++++++++++++
>   1 file changed, 27 insertions(+)

Acked-by: Richard Henderson <rth@twiddle.net>


r~

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-28 18:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1458788612-4367-1-git-send-email-zhaoxiu.zeng@gmail.com>
2016-03-27  5:43 ` [PATCH 03/31] Add alpha-specific parity functions zhaoxiu.zeng
2016-03-28 18:33   ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox