]> Savannah Git Hosting - gnulib.git/commit
stdbit: redo clzll without lookcup table
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 13 May 2024 22:21:55 +0000 (15:21 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 13 May 2024 22:22:17 +0000 (15:22 -0700)
commit1b7e82be9dd80fbb67a5567cdf1d60d36dd40db2
tree082cbfbd0690b0f290a7382515115d37b98a3489
parent59b39732ddacf818d2c9cb6086a0f31dd252944d
stdbit: redo clzll without lookcup table

* lib/stdbit.c (__gl_stdbit_clztab):
* lib/stdbit.in.h (__gl_stdbit_clzll):
[!_GL_STDBIT_HAS_BUILTIN_CLZ && !_MSC_VER]: Rewrite to avoid the
need for a lookup table in memory, and remove the lookup table.
Do this by shrinking the table to 64 bits and puttiung in a 64-bit
constant.  Although this needs another round of shifts, it avoids
the need for a multiplication and memory access a la de Bruijn,
and is probably a win.
ChangeLog
lib/stdbit.c
lib/stdbit.in.h