From: Joe Perches <joe@perches.com>
To: zengzhaoxiu@163.com, linux-kernel@vger.kernel.org
Cc: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>,
Steven Miao <realmz6@gmail.com>,
adi-buildroot-devel@lists.sourceforge.net
Subject: Re: [PATCH V3] blackfin: optimize ffz, __ffs, ffs, __fls, and fls functions
Date: Fri, 15 Apr 2016 09:08:34 -0700 [thread overview]
Message-ID: <1460736514.19090.32.camel@perches.com> (raw)
In-Reply-To: <1460733645-77406-1-git-send-email-zengzhaoxiu@163.com>
On Fri, 2016-04-15 at 23:20 +0800, zengzhaoxiu@163.com wrote:
> From: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.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));
next prev parent reply other threads:[~2016-04-15 16:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-15 7:52 [PATCH] blackfin: optimize ffz, __ffs, ffs, __fls, and fls functions zengzhaoxiu
2016-04-15 8:23 ` [PATCH V2] " zengzhaoxiu
2016-04-15 9:16 ` [PATCH] " kbuild test robot
2016-04-15 15:20 ` [PATCH V3] " zengzhaoxiu
2016-04-15 16:08 ` Joe Perches [this message]
2016-04-15 16:18 ` 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=1460736514.19090.32.camel@perches.com \
--to=joe@perches.com \
--cc=adi-buildroot-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=realmz6@gmail.com \
--cc=zengzhaoxiu@163.com \
--cc=zhaoxiu.zeng@gmail.com \
/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.