>From 4069d42575181bd484af4f433c0d0d5358470a80 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 22 Dec 2019 09:34:06 +0100 Subject: [PATCH 03/15] 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. --- ChangeLog | 8 ++++++++ lib/count-one-bits.h | 2 -- m4/count-one-bits.m4 | 12 ------------ modules/count-one-bits | 2 -- tests/test-count-one-bits.c | 6 ++---- 5 files changed, 10 insertions(+), 20 deletions(-) delete mode 100644 m4/count-one-bits.m4 diff --git a/ChangeLog b/ChangeLog index e68cfa1..81eb5e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2019-12-22 Bruno Haible + 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. + count-trailing-zeros: Assume that the compiler supports 'long long'. * lib/count-trailing-zeros.h (count_trailing_zeros_ll): Define unconditionally. diff --git a/lib/count-one-bits.h b/lib/count-one-bits.h index 0056994..440d1aa 100644 --- a/lib/count-one-bits.h +++ b/lib/count-one-bits.h @@ -122,14 +122,12 @@ count_one_bits_l (unsigned long int x) COUNT_ONE_BITS (__builtin_popcountl, __popcnt, unsigned long int); } -#if HAVE_UNSIGNED_LONG_LONG_INT /* Compute and return the number of 1-bits set in X. */ COUNT_ONE_BITS_INLINE int count_one_bits_ll (unsigned long long int x) { COUNT_ONE_BITS (__builtin_popcountll, __popcnt64, unsigned long long int); } -#endif _GL_INLINE_HEADER_END diff --git a/m4/count-one-bits.m4 b/m4/count-one-bits.m4 deleted file mode 100644 index b4721b5..0000000 --- a/m4/count-one-bits.m4 +++ /dev/null @@ -1,12 +0,0 @@ -# count-one-bits.m4 serial 3 -dnl Copyright (C) 2007, 2009-2019 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -AC_DEFUN([gl_COUNT_ONE_BITS], -[ - dnl We don't need (and can't compile) count_one_bits_ll - dnl unless the type 'unsigned long long int' exists. - AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) -]) diff --git a/modules/count-one-bits b/modules/count-one-bits index 7bb18bd..ddceacd 100644 --- a/modules/count-one-bits +++ b/modules/count-one-bits @@ -4,13 +4,11 @@ Counts the number of 1-bits in a word. Files: lib/count-one-bits.c lib/count-one-bits.h -m4/count-one-bits.m4 Depends-on: extern-inline configure.ac: -gl_COUNT_ONE_BITS Makefile.am: lib_SOURCES += count-one-bits.c diff --git a/tests/test-count-one-bits.c b/tests/test-count-one-bits.c index 852e1d6..d12838f 100644 --- a/tests/test-count-one-bits.c +++ b/tests/test-count-one-bits.c @@ -66,10 +66,8 @@ main (int argc, char *argv[]) TEST_COUNT_ONE_BITS (count_one_bits, unsigned int, UINT_BIT, UINT_MAX, 1U); TEST_COUNT_ONE_BITS (count_one_bits_l, unsigned long int, ULONG_BIT, ULONG_MAX, 1UL); -#ifdef HAVE_UNSIGNED_LONG_LONG_INT - TEST_COUNT_ONE_BITS (count_one_bits_ll, - unsigned long long int, ULLONG_BIT, ULLONG_MAX, 1ULL); -#endif + TEST_COUNT_ONE_BITS (count_one_bits_ll, unsigned long long int, + ULLONG_BIT, ULLONG_MAX, 1ULL); return 0; } -- 2.7.4