lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 15 Apr 2016 09:08:34 -0700
From:	Joe Perches <joe@...ches.com>
To:	zengzhaoxiu@....com, linux-kernel@...r.kernel.org
Cc:	Zeng Zhaoxiu <zhaoxiu.zeng@...il.com>,
	Steven Miao <realmz6@...il.com>,
	adi-buildroot-devel@...ts.sourceforge.net
Subject: Re: [PATCH V3] blackfin: optimize ffz, __ffs, ffs, __fls, and fls
 functions

On Fri, 2016-04-15 at 23:20 +0800, zengzhaoxiu@....com wrote:
> From: Zeng Zhaoxiu <zhaoxiu.zeng@...il.com>
> 
> blackfin has popcount instruction (ONES), we can do the efficient
> computing (ffz, __ffs, ffs, __fls, and fls) use this instruction.
[]
> diff --git a/arch/blackfin/include/asm/bitops.h b/arch/blackfin/include/asm/bitops.h
[]
> +static inline unsigned int __arch_hweight64(__u64 w)
> +{
> +	return __arch_hweight32((unsigned int)(w >> 32)) +
> +	       __arch_hweight32((unsigned int)w);
> +}

trivia:  perhaps this is more readable as:

	return __arch_hweight32(upper_32_bits(w)) +
	       __arch_hweight32(lower_32_bits(w));

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ