1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2025-08-08 17:22:05 +03:00

6 Commits

Author SHA1 Message Date
Bruno Haible
4069d42575 count-one-bits: Assume that the compiler supports 'long long'.
* lib/count-one-bits.h (count_one_bits_ll): Define unconditionally.
* m4/count-one-bits.m4: Remove file.
* modules/count-one-bits (Files): Remove it.
(configure.ac): Don't invoke gl_COUNT_ONE_BITS.
* tests/test-count-one-bits.c (main): Test count_one_bits_ll
unconditionally.
2019-12-22 09:34:06 +01:00
Paul Eggert
75588b6ed2 count-one-bits: port to MSC; support types wider than 64 bits
The ideas behind the MSC port are stolen from Emacs.
* lib/count-one-bits.c (popcount_support) [_MSC_VER]: New variable.
* lib/count-one-bits.h: Include limits.h, for CHAR_BIT.
Don't include verify.h: it's no longer needed, as types wider than
64 bits are now supported.
(COUNT_ONE_BITS_GENERIC): New macro.
(popcount_supported) [_MSC_VER]: New inline function.
(COUNT_ONE_BITS): Use it.  New arg MSC_BUILTIN, for better
performance with MSC.  All uses changed.  Do not assume that TYPE
has at most 64 bits.
* modules/count-one-bits (Depends-on): Do not depend on 'verify'.
2013-10-07 00:03:00 -07:00
Paul Eggert
aa7a0991de count-one-bits: better 'inline'
* lib/count-one-bits.c: New file.
* lib/count-one-bits.h (COUNT_ONE_BITS_INLINE):
New macro.  Replace all uses of 'static inline' with it.
Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
* m4/count-one-bits.m4 (gl_COUNT_ONE_BITS):
Do not require AC_C_INLINE.
* modules/count-one-bits (Files, lib_SOURCES):
Add lib/count-one-bits.c.
(Depends-on): Add extern-inline.
2012-11-29 23:38:50 -08:00
Bruno Haible
69fe567051 Use AC_C_INLINE instead of module 'inline' where possible. 2009-12-31 17:28:37 +01:00
Eric Blake
a428fac0e9 count-one-bits: relax license
* modules/count-one-bits (License): Relicense to LGPLv2+.
Suggested by Ludovic Courtès, approved by Ben Pfaff.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-08-22 13:47:52 -06:00
Ben Pfaff
e9cfd9f2d0 Improve name: "count-one-bits" is better than "popcount".
* MODULES.html.sh: Update name.
* lib/popcount.h: Renamed lib/count-one-bits.h.
(popcount): Renamed count_one_bits.
(popcountl): Renamed count_one_bits_l.
(popcountll): Renamed count_one_bits_ll.
* m4/popcount.m4: Renamed m4/count-one-bits.m4.
* modules/popcount: Renamed module/count-one-bits.
* modules/popcount-tests: Renamed module/count-one-bits-tests.
* tests/test-popcount.c: Renamed tests/test-count-one-bits.c.
2007-07-25 03:13:19 +00:00