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.
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
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.
>>> + */
>>> +
在 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
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) &
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
6 matches
Mail list logo