lkml.org 
[lkml]   [2016]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 10/31] Add sparc-specific parity functions
From
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.

\
 
 \ /
  Last update: 2016-03-28 05:21    [W:0.138 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site