Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1365062

[PATCH 06/31] Add ia64-specific parity functions

From "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 06/31] Add ia64-specific parity functions
Date 2016-03-27 08:10 +0200
Message-ID <rhc3E-45f-5@gated-at.bofh.it> (permalink)
References <rg3ON-4FE-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

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

diff --git a/arch/ia64/include/asm/bitops.h b/arch/ia64/include/asm/bitops.h
index 71e8145..de13d89 100644
--- a/arch/ia64/include/asm/bitops.h
+++ b/arch/ia64/include/asm/bitops.h
@@ -439,6 +439,22 @@ static __inline__ unsigned long __arch_hweight64(unsigned long x)
 
 #include <asm-generic/bitops/const_hweight.h>
 
+/*
+ * parityN: returns the parity of a N-bit word,
+ * i.e. the number of 1-bits in x modulo 2.
+ */
+static __inline__ unsigned int __arch_parity64(unsigned long x)
+{
+	return (unsigned int)ia64_popcnt(x) & 1;
+}
+
+#define __arch_parity32(x) ((unsigned int) __arch_parity64((x) & 0xfffffffful))
+#define __arch_parity16(x) ((unsigned int) __arch_parity64((x) & 0xfffful))
+#define __arch_parity8(x)  ((unsigned int) __arch_parity64((x) & 0xfful))
+#define __arch_parity4(x)  ((unsigned int) __arch_parity64((x) & 0xful))
+
+#include <asm-generic/bitops/const_parity.h>
+
 #endif /* __KERNEL__ */
 
 #include <asm-generic/bitops/find.h>
-- 
2.5.5

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 01/31] bitops: add parity functions Zhaoxiu Zeng <zhaoxiu.zeng@gmail.com> - 2016-03-24 04:10 +0100
  Re: [PATCH 01/31] bitops: add parity functions Denys Vlasenko <dvlasenk@redhat.com> - 2016-03-24 09:40 +0100
    Re: [PATCH 01/31] bitops: add parity functions Andrew Morton <akpm@linux-foundation.org> - 2016-03-24 23:30 +0100
      Re: [PATCH 01/31] bitops: add parity functions Martin Kepplinger <martink@posteo.de> - 2016-03-26 23:10 +0100
        Re: [PATCH 01/31] bitops: add parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 10:00 +0200
    Re: [PATCH 01/31] bitops: add parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 05:40 +0200
      Re: [PATCH 01/31] bitops: add parity functions Sam Ravnborg <sam@ravnborg.org> - 2016-03-27 14:50 +0200
        Re: [PATCH 01/31] bitops: add parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 15:40 +0200
          Re: [PATCH 01/31] bitops: add parity functions Sam Ravnborg <sam@ravnborg.org> - 2016-03-27 20:00 +0200
            Re: [PATCH 01/31] bitops: add parity functions Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com> - 2016-03-28 04:50 +0200
          Re: [PATCH 01/31] bitops: add parity functions Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com> - 2016-03-28 04:20 +0200
      Re: [PATCH 01/31] bitops: add parity functions Sam Ravnborg <sam@ravnborg.org> - 2016-03-28 09:00 +0200
        Re: [PATCH 01/31] bitops: add parity functions Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com> - 2016-03-29 04:30 +0200
          Re: [PATCH 01/31] bitops: add parity functions Joe Perches <joe@perches.com> - 2016-03-29 05:00 +0200
  [PATCH 02/31] Include generic parity.h in some architectures'  bitops.h "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 06:10 +0200
  [PATCH 03/31] Add alpha-specific parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 07:50 +0200
    Re: [PATCH 03/31] Add alpha-specific parity functions Richard Henderson <rth@twiddle.net> - 2016-03-28 20:40 +0200
  [PATCH 04/31] Add avr32-specific parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 07:50 +0200
    Re: [PATCH 04/31] Add avr32-specific parity functions Hans-Christian Noren Egtvedt <egtvedt@samfundet.no> - 2016-03-28 22:10 +0200
  [PATCH 05/31] Add blackfin-specific parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 08:00 +0200
  [PATCH 07/31] Add mips-specific parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 08:10 +0200
    Re: [PATCH 07/31] Add mips-specific parity functions David Daney <ddaney.cavm@gmail.com> - 2016-03-28 19:30 +0200
      Re: [PATCH 07/31] Add mips-specific parity functions Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com> - 2016-03-29 04:20 +0200
  [PATCH 06/31] Add ia64-specific parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 08:10 +0200
  [PATCH 08/31] Add tile-specific parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 08:20 +0200
  [PATCH 09/31] Add powerpc-specific parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 08:40 +0200
  [PATCH 11/31] Add x86-specific parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 08:50 +0200
    Re: [PATCH 11/31] Add x86-specific parity functions One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2016-03-29 14:20 +0200
  [PATCH 10/31] Add sparc-specific parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 08:50 +0200
    Re: [PATCH 10/31] Add sparc-specific parity functions David Miller <davem@davemloft.net> - 2016-03-28 04:50 +0200
      Re: [PATCH 10/31] Add sparc-specific parity functions Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com> - 2016-03-28 07:50 +0200
        Re: [PATCH 10/31] Add sparc-specific parity functions David Miller <davem@davemloft.net> - 2016-03-28 17:30 +0200
          Re: [PATCH 10/31] Add sparc-specific parity functions Sam Ravnborg <sam@ravnborg.org> - 2016-03-28 17:40 +0200
            Re: [PATCH 10/31] Add sparc-specific parity functions David Miller <davem@davemloft.net> - 2016-03-28 17:50 +0200
  [PATCH 12/31] sunrpc: auth_gss: use parity8 "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:00 +0200
  [PATCH 13/31] mips: use parity functions in cerr-sb1.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:00 +0200
  [PATCH 15/31] media: use parity8 in vivid-vbi-gen.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:10 +0200
  [PATCH 14/31] lib: bch: use parity32 "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:10 +0200
  [PATCH 17/31] input: joystick: use parity32 in grip_mp.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:20 +0200
  [PATCH 18/31] input: joystick: use parity64 in sidewinder.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:20 +0200
  [PATCH 16/31] media: saa7115: use parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:20 +0200
  [PATCH 19/31] input: serio: use parity16 in ams_delta_serio.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:20 +0200
  [PATCH 22/31] mtd: use parity functions in inftlcore.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:30 +0200
  [PATCH 21/31] mtd: use parity16 in ssfdc.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:30 +0200
    Re: [PATCH 21/31] mtd: use parity16 in ssfdc.c Brian Norris <computersforpeace@gmail.com> - 2016-04-02 01:50 +0200
  [PATCH 20/31] scsi: use parity32 in isci/phy.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:30 +0200
  [PATCH 26/31] input: serio: use parity8 in pcips2.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:40 +0200
  [PATCH 25/31] ethernet: use parity8 in sun/niu.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:40 +0200
    Re: [PATCH 25/31] ethernet: use parity8 in sun/niu.c Michal Nazarewicz <mina86@mina86.com> - 2016-03-28 16:40 +0200
  [PATCH 24/31] mtd: use parity16 in sm_ftl.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:40 +0200
  [PATCH 23/31] crypto: qat: use parity functions in qat_hal.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:40 +0200
  [PATCH 28/31] iio: gyro: use parity32 in adxrs450.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:50 +0200
    Re: [PATCH 28/31] iio: gyro: use parity32 in adxrs450.c Jonathan Cameron <jic23@kernel.org> - 2016-03-28 10:40 +0200
      Re: [PATCH 28/31] iio: gyro: use parity32 in adxrs450.c Lars-Peter Clausen <lars@metafoo.de> - 2016-03-28 11:30 +0200
  [PATCH 29/31] serial: use parity32 in max3100.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:50 +0200
  [PATCH 30/31] input: mouse: use parity8 in elantech "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:50 +0200
  [PATCH 27/31] input: serio: use parity8 in sa1111ps2.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:50 +0200
  [PATCH 31/31] ethernet: broadcom: use parity8 in tg3.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 10:00 +0200

csiph-web