All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org
Subject: Re: [PATCH 10/31] Add sparc-specific parity functions
Date: Mon, 28 Mar 2016 05:44:03 +0000	[thread overview]
Message-ID: <56F8C4A3.1070808@gmail.com> (raw)
In-Reply-To: <20160327.224308.220596078048860811.davem@davemloft.net>

在 2016年03月28日 10:43, David Miller 写道:
> From: "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com>
> 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) & 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)
> This looks like asm-generic/ material to me.

This is generic for the architectures which have popcount instruction,
but more higher costs than asm-generic/ for others.



WARNING: multiple messages have this Message-ID (diff)
From: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org
Subject: Re: [PATCH 10/31] Add sparc-specific parity functions
Date: Mon, 28 Mar 2016 13:44:03 +0800	[thread overview]
Message-ID: <56F8C4A3.1070808@gmail.com> (raw)
In-Reply-To: <20160327.224308.220596078048860811.davem@davemloft.net>

在 2016年03月28日 10:43, David Miller 写道:
> From: "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com>
> 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) & 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)
> This looks like asm-generic/ material to me.

This is generic for the architectures which have popcount instruction,
but more higher costs than asm-generic/ for others.

  reply	other threads:[~2016-03-28  5:44 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-24  3:03 [PATCH 01/31] bitops: add parity functions Zhaoxiu Zeng
2016-03-24  8:38 ` Denys Vlasenko
2016-03-24 22:28   ` Andrew Morton
2016-03-26 22:08     ` Martin Kepplinger
2016-03-27  7:51       ` zhaoxiu.zeng
2016-03-27  3:33   ` zhaoxiu.zeng
2016-03-27 12:44     ` Sam Ravnborg
2016-03-27 13:38       ` zhaoxiu.zeng
2016-03-27 17:56         ` Sam Ravnborg
2016-03-28  2:44           ` Zeng Zhaoxiu
2016-03-28  2:15         ` Zeng Zhaoxiu
2016-03-28  6:51     ` Sam Ravnborg
2016-03-29  2:27       ` Zeng Zhaoxiu
2016-03-29  2:56         ` Joe Perches
2016-03-27  4:02 ` [PATCH 02/31] Include generic parity.h in some architectures' bitops.h zhaoxiu.zeng
2016-03-27  4:02   ` zhaoxiu.zeng
2016-03-27  4:02   ` zhaoxiu.zeng
2016-03-27  4:02   ` zhaoxiu.zeng
2016-03-27  4:02   ` zhaoxiu.zeng
2016-03-27  4:02 ` zhaoxiu.zeng
2016-03-27  5:43 ` [PATCH 03/31] Add alpha-specific parity functions zhaoxiu.zeng
2016-03-28 18:33   ` Richard Henderson
2016-03-27  5:47 ` [PATCH 04/31] Add avr32-specific " zhaoxiu.zeng
2016-03-28 20:00   ` Hans-Christian Noren Egtvedt
2016-03-27  5:53 ` [PATCH 05/31] Add blackfin-specific " zhaoxiu.zeng
2016-03-27  6:00 ` [PATCH 06/31] Add ia64-specific " zhaoxiu.zeng
2016-03-27  6:00   ` zhaoxiu.zeng
2016-03-27  6:06 ` [PATCH 07/31] Add mips-specific " zhaoxiu.zeng
2016-03-28 17:25   ` David Daney
2016-03-29  2:15     ` Zeng Zhaoxiu
2016-03-27  6:10 ` [PATCH 08/31] Add tile-specific " zhaoxiu.zeng
2016-03-27  6:37 ` [PATCH 09/31] Add powerpc-specific " zhaoxiu.zeng
2016-03-27  6:43 ` [PATCH 10/31] Add sparc-specific " zhaoxiu.zeng
2016-03-27  6:43   ` zhaoxiu.zeng
2016-03-28  2:43   ` David Miller
2016-03-28  2:43     ` David Miller
2016-03-28  5:44     ` Zeng Zhaoxiu [this message]
2016-03-28  5:44       ` Zeng Zhaoxiu
2016-03-28 15:29       ` David Miller
2016-03-28 15:29         ` David Miller
2016-03-28 15:37         ` Sam Ravnborg
2016-03-28 15:37           ` Sam Ravnborg
2016-03-28 15:46           ` David Miller
2016-03-28 15:46             ` David Miller
2016-03-27  6:45 ` [PATCH 11/31] Add x86-specific " zhaoxiu.zeng
2016-03-29 12:11   ` One Thousand Gnomes
2016-03-27  6:51 ` [PATCH 12/31] sunrpc: auth_gss: use parity8 zhaoxiu.zeng
2016-03-27  6:51   ` zhaoxiu.zeng
2016-03-27  6:55 ` [PATCH 13/31] mips: use parity functions in cerr-sb1.c zhaoxiu.zeng
2016-03-27  7:01 ` [PATCH 14/31] lib: bch: use parity32 zhaoxiu.zeng
2016-03-27  7:06 ` [PATCH 15/31] media: use parity8 in vivid-vbi-gen.c zhaoxiu.zeng
2016-03-27  7:10 ` [PATCH 16/31] media: saa7115: use parity functions zhaoxiu.zeng
2016-03-27  7:13 ` [PATCH 17/31] input: joystick: use parity32 in grip_mp.c zhaoxiu.zeng
2016-03-27  7:15 ` [PATCH 18/31] input: joystick: use parity64 in sidewinder.c zhaoxiu.zeng
2016-03-27  7:18 ` [PATCH 19/31] input: serio: use parity16 in ams_delta_serio.c zhaoxiu.zeng
2016-03-27  7:20 ` [PATCH 20/31] scsi: use parity32 in isci/phy.c zhaoxiu.zeng
2016-03-27  7:24 ` [PATCH 21/31] mtd: use parity16 in ssfdc.c zhaoxiu.zeng
2016-04-01 23:48   ` Brian Norris
2016-03-27  7:27 ` [PATCH 22/31] mtd: use parity functions in inftlcore.c zhaoxiu.zeng
2016-03-27  7:30 ` [PATCH 23/31] crypto: qat: use parity functions in qat_hal.c zhaoxiu.zeng
2016-03-27  7:33 ` [PATCH 24/31] mtd: use parity16 in sm_ftl.c zhaoxiu.zeng
2016-03-27  7:36 ` [PATCH 25/31] ethernet: use parity8 in sun/niu.c zhaoxiu.zeng
2016-03-28 14:33   ` Michal Nazarewicz
2016-03-27  7:38 ` [PATCH 26/31] input: serio: use parity8 in pcips2.c zhaoxiu.zeng
2016-03-27  7:40 ` [PATCH 27/31] input: serio: use parity8 in sa1111ps2.c zhaoxiu.zeng
2016-03-27  7:42 ` [PATCH 28/31] iio: gyro: use parity32 in adxrs450.c zhaoxiu.zeng
2016-03-28  8:35   ` Jonathan Cameron
2016-03-28  8:50     ` Lars-Peter Clausen
2016-03-27  7:44 ` [PATCH 29/31] serial: use parity32 in max3100.c zhaoxiu.zeng
2016-03-27  7:48 ` [PATCH 30/31] input: mouse: use parity8 in elantech zhaoxiu.zeng
2016-03-27  7:50 ` [PATCH 31/31] ethernet: broadcom: use parity8 in tg3.c zhaoxiu.zeng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56F8C4A3.1070808@gmail.com \
    --to=zhaoxiu.zeng@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sparclinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.