From: Michael Ellerman <patch-notifications@ellerman.id.au>
To: Christophe Leroy <christophe.leroy@c-s.fr>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>, Scott Wood <oss@buserror.net>
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [1/4] powerpc: Discard ffs()/__ffs() function and use builtin functions instead
Date: Mon, 5 Jun 2017 20:21:49 +1000 (AEST) [thread overview]
Message-ID: <3wh9pj6YD0z9sD5@ozlabs.org> (raw)
In-Reply-To: <a0105d18c39c419ed3b30270d0c2f30d10aa1947.1492772606.git.christophe.leroy@c-s.fr>
On Fri, 2017-04-21 at 11:18:46 UTC, Christophe Leroy wrote:
> With the ffs() function as defined in arch/powerpc/include/asm/bitops.h
> GCC will not optimise the code in case of constant parameter, as shown
> by the small exemple below.
...
>
> In addition, when reading the generated vmlinux, we can observe
> that with the builtin functions, GCC sometimes efficiently spreads
> the instructions within the generated functions while the inline
> assembly force them to remain grouped together.
>
> __builtin_ffs() is already used in arch/powerpc/include/asm/page_32.h
>
> Those builtins have been in GCC since at least 3.4.6 (see
> https://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Other-Builtins.html )
>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Series applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/f83647d642270f6b9d75736817fb5a
cheers
next prev parent reply other threads:[~2017-06-05 10:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-21 11:18 [PATCH 0/4] powerpc: Replace some bitops functions by builtin/generic ones Christophe Leroy
2017-04-21 11:18 ` [PATCH 1/4] powerpc: Discard ffs()/__ffs() function and use builtin functions instead Christophe Leroy
2017-06-05 10:21 ` Michael Ellerman [this message]
2017-04-21 11:18 ` [PATCH 2/4] powerpc: Use builtin functions for fls()/__fls()/fls64() Christophe Leroy
2017-04-21 11:18 ` [PATCH 3/4] powerpc: Replace ffz() by equivalent generic function Christophe Leroy
2017-04-21 11:18 ` [PATCH 4/4] powerpc: remove __ilog2()s and use generic ones Christophe Leroy
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=3wh9pj6YD0z9sD5@ozlabs.org \
--to=patch-notifications@ellerman.id.au \
--cc=benh@kernel.crashing.org \
--cc=christophe.leroy@c-s.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=oss@buserror.net \
--cc=paulus@samba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).