count-leading-zeros: use a lookup table on non-gcc compilers
authorEric Blake <eblake@redhat.com>
Sat, 11 Aug 2012 13:34:00 +0000 (07:34 -0600)
committerEric Blake <eblake@redhat.com>
Sat, 11 Aug 2012 13:36:19 +0000 (07:36 -0600)
commitd22f151db0e5217913ec1667a3b4e354dd88a973
tree4301229ac796285acfeb83495f291f758c7f9c06
parent0da76a94c8668319c68af5e8c2e71c80528db5de
count-leading-zeros: use a lookup table on non-gcc compilers

While this only affects non-gcc compilers, we can assume that
lookups are faster than conditionals, even if it results in
a slightly larger executable size.

* lib/count-leading-zeros.h (count_leading_zeros_32): Use an
alternate implementation, suggested by Jim Meyering.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
lib/count-leading-zeros.h