allow ffs & co. a binary search
Ian Lepore
ian at freebsd.org
Thu Jun 11 14:52:55 UTC 2015
On Thu, 2015-06-11 at 10:49 -0400, Richard Yao wrote:
> On 06/06/2015 08:13 PM, Erich Dollansky wrote:
[...]
>
> The fastest portable way of calculating highest bit set is to use a
> debrujin sequence:
>
> https://graphics.stanford.edu/~seander/bithacks.html#IntegerLogDeBruijn
>
> The binary approach is inferior, especially on Pentium 4 processors.
And of course it's crucial that we optimize for Pentium 4 processors in
2015.
-- Ian
More information about the freebsd-hackers
mailing list