summaryrefslogtreecommitdiff
path: root/lib/count-leading-zeros.h
Commit message (Collapse)AuthorAgeFilesLines
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* all: Replace many more http URLs by https URLs. Update stale URLs.Bruno Haible2017-09-141-1/+2
| | | | | * users.txt: Remove mention of 'newts'. * lib/localename.c: Update comment about LANG_SOTHO.
* all: prefer https: URLsPaul Eggert2017-09-131-1/+1
|
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* count-leading-zeros: use 64-bit intrinsics on 32-bit WindowsPaul Eggert2015-01-061-5/+0
| | | | | | | | | This reverts the last patch but one, as it shouldn't be needed now that the typo is fixed. * lib/count-leading-zeros.h (count_leading_zeros_ll): * lib/count-trailing-zeros.h: * lib/count-one-bits.h: Go back to using 64-bit intrinsics.
* count-leading-zeros: fix pragma typosPaul Eggert2015-01-061-2/+2
| | | | | * lib/count-leading-zeros.h (_BitScanReverse, _BitScanReverse64): Fix typos in declaration of intrinsics when _MSC_VER.
* count-leading-zeros: avoid 64-bit intrinsics on 32-bit WindowsPádraig Brady2015-01-061-0/+5
| | | | | | | * lib/count-leading-zeros.h (count_leading_zeros_ll): Use 32 bit intrinsics in this case. * lib/count-trailing-zeros.h: Likewise. * lib/count-one-bits.h: Likewise.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* count-leading-zeros: port to MSC; support types wider than 64 bitsPaul Eggert2013-10-071-28/+41
| | | | | | | | | | | | The ideas behind the MSC port are stolen from Emacs. * lib/count-leading-zeros.h: Don't include verify.h: it's no longer needed, as types wider than 64 bits are now supported. (COUNT_LEADING_ZEROS): New arg MSC_BUILTIN, for better performance with MSC. All uses changed. Do not assume that TYPE has at most 64 bits. (count_leading_zeros_32): Assume 0 < X < 2**32, for speed. All uses changed. Fold the subtraction from 31 into the table.
* headers: check that _GL_INLINE_HEADER_BEGIN is definedPaul Eggert2013-08-281-0/+3
| | | | | | | | | | | | | | | | | | | | Suggested by Bruce Korb in: http://lists.gnu.org/archive/html/bug-gnulib/2013-08/msg00070.html * doc/extern-inline.texi (extern inline): Suggest checking that _GL_INLINE_HEADER_BEGIN is defined. * lib/acl-internal.h, lib/argp-fmtstream.h, lib/argp.h: * lib/binary-io.h, lib/bitrotate.h, lib/count-leading-zeros.h: * lib/count-one-bits.h, lib/eealloc.h, lib/execinfo.in.h: * lib/gethrxtime.h, lib/gl_list.h, lib/gl_oset.h, lib/gl_xlist.h: * lib/gl_xoset.h, lib/gl_xsublist.h, lib/glthread/cond.h: * lib/glthread/thread.h, lib/math.in.h, lib/mbchar.h, lib/mbfile.h: * lib/mbiter.h, lib/mbuiter.h, lib/openat.h, lib/pipe-filter-aux.h: * lib/priv-set.h, lib/pthread.in.h, lib/savewd.h, lib/se-context.in.h: * lib/se-selinux.in.h, lib/sig-handler.h, lib/stat-time.h: * lib/sys_socket.in.h, lib/timespec.h, lib/u64.h, lib/unistd.in.h: * lib/utimens.h, lib/wctype.in.h, lib/xalloc.h, lib/xsize.h: * lib/xtime.h: Check that _GL_INLINE_HEADER_BEGIN is defined.
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* count-leading-zeros: better 'inline'Paul Eggert2012-11-291-4/+11
| | | | | | | | | | | | * 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.
* count-leading-zeros: use a lookup table on non-gcc compilersEric Blake2012-08-111-25/+16
| | | | | | | | | | | 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>
* count-leading-zeros: new moduleEric Blake2012-08-101-0/+100
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>