This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Commit: Add note merging to strip, and add merging of stack size notes


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]