[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <56F77FBA.1090304@gmail.com>
Date: Sun, 27 Mar 2016 14:37:46 +0800
From: "zhaoxiu.zeng" <zhaoxiu.zeng@...il.com>
To: Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Michael Ellerman <mpe@...erman.id.au>,
Torsten Duwe <duwe@....de>, Scott Wood <oss@...error.net>,
Anton Blanchard <anton@...ba.org>,
Christophe Leroy <christophe.leroy@....fr>
Cc: linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org
Subject: [PATCH 09/31] Add powerpc-specific parity functions
From: Zeng Zhaoxiu <zhaoxiu.zeng@...il.com>
Signed-off-by: Zeng Zhaoxiu <zhaoxiu.zeng@...il.com>
---
arch/powerpc/include/asm/bitops.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h
index 59abc62..90ee0f2 100644
--- a/arch/powerpc/include/asm/bitops.h
+++ b/arch/powerpc/include/asm/bitops.h
@@ -269,8 +269,15 @@ unsigned int __arch_hweight16(unsigned int w);
unsigned int __arch_hweight32(unsigned int w);
unsigned long __arch_hweight64(__u64 w);
#include <asm-generic/bitops/const_hweight.h>
+#define __arch_parity4(w) (__arch_hweight8((w) & 0xf) & 1)
+#define __arch_parity8(w) (__arch_hweight8(w) & 1)
+#define __arch_parity16(w) (__arch_hweight16(w) & 1)
+#define __arch_parity32(w) (__arch_hweight32(w) & 1)
+#define __arch_parity64(w) ((unsigned int)__arch_hweight64(w) & 1)
+#include <asm-generic/bitops/const_parity.h>
#else
#include <asm-generic/bitops/hweight.h>
+#include <asm-generic/bitops/parity.h>
#endif
#include <asm-generic/bitops/find.h>
--
2.5.5
Powered by blists - more mailing lists