From: Florian Weimer <fweimer@redhat.com>
To: Nick Clifton <nickc@redhat.com>, binutils@sourceware.org
Subject: Re: Commit: Add note merging to strip, and add merging of stack size notes
Date: Sat, 15 Apr 2017 14:44:00 -0000 [thread overview]
Message-ID: <c420b8bc-6104-accc-a08e-a4c727bf9d4b@redhat.com> (raw)
In-Reply-To: <87pogge7rj.fsf@redhat.com>
On 04/13/2017 03:50 PM, Nick Clifton wrote:
> + /* FIXME: There must be a faster way to do this. */
> + while (val)
> + {
> + count ++;
> + val >>= 8;
> + }
__builtin_clz. It's a single instruction on many targets, but its
performance characteristics on modern x86-64 CPUs are a bit weird. If
the values are small (almost always just one bytes), it's unlikely to be
a win over your loop. And __builtin_clz is much worse on targets which
do not have a dedicated instruction for this, or a building block for
building it.
Florian
prev parent reply other threads:[~2017-04-15 14:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-13 13:50 Nick Clifton
2017-04-15 14:44 ` Florian Weimer [this message]
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=c420b8bc-6104-accc-a08e-a4c727bf9d4b@redhat.com \
--to=fweimer@redhat.com \
--cc=binutils@sourceware.org \
--cc=nickc@redhat.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 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 read-only IMAP folder(s) and NNTP newsgroup(s).