| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
* lib/count-leading-zeros.h (count_leading_zeros_ll): Define
unconditionally.
* m4/count-leading-zeros.m4: Remove file.
* modules/count-leading-zeros (Files): Remove it.
(configure.ac): Don't invoke gl_COUNT_LEADING_ZEROS.
* tests/test-count-leading-zeros.c (main): Test count_leading_zeros_ll
unconditionally.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib/count-leading-zeros.c: New file.
* lib/count-leading-zeros.h (COUNT_LEADING_ZEROS_INLINE):
New macro. Replace all uses of 'static inline' with it.
Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
* m4/count-leading-zeros.m4 (gl_COUNT_LEADING_ZEROS):
Do not require AC_C_INLINE.
* modules/count-leading-zeros (Files, lib_SOURCES):
Add lib/count-leading-zeros.c.
(Depends-on): Add extern-inline.
|
|
I needed gcc's clz to determine the most significant bit of a
number (useful for things like truncating to a power of 2),
and was surprised it is not a standardized function (the
opposite direction of finding the least significant bit is
given by ffs). This borrows heavily from the design of the
count-one-bits module.
* modules/count-leading-zeros: New module.
* m4/count-leading-zeros.m4: New file.
* lib/count-leading-zeros.h: Likewise.
* modules/count-leading-zeros-tests: New test.
* tests/test-count-leading-zeros.c: New file.
* MODULES.html.sh (Integer arithmetic functions): Document it.
Signed-off-by: Eric Blake <eblake@redhat.com>
|