This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Commit: Add note merging to strip, and add merging of stack size notes
- From: Florian Weimer <fweimer at redhat dot com>
- To: Nick Clifton <nickc at redhat dot com>, binutils at sourceware dot org
- Date: Sat, 15 Apr 2017 16:44:47 +0200
- Subject: Re: Commit: Add note merging to strip, and add merging of stack size notes
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=fweimer at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 303C590E64
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 303C590E64
- References: <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