]> Savannah Git Hosting - gnulib.git/commitdiff
count-leading-zeros: Assume that the compiler supports 'long long'.
authorBruno Haible <bruno@clisp.org>
Sun, 22 Dec 2019 08:32:07 +0000 (09:32 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 22 Dec 2019 08:32:37 +0000 (09:32 +0100)
* 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.

ChangeLog
lib/count-leading-zeros.h
m4/count-leading-zeros.m4 [deleted file]
modules/count-leading-zeros
tests/test-count-leading-zeros.c

index 5ac5ee6827329092ae9537b35c00656a77655276..3e772e4f125ef27f9b6a879747dd5bb3c284d495 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2019-12-22  Bruno Haible  <bruno@clisp.org>
+
+       count-leading-zeros: Assume that the compiler supports 'long long'.
+       * 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.
+
 2019-12-22  Bruno Haible  <bruno@clisp.org>
 
        localcharset: Update support for OpenBSD.
index cf867acc530e861f563a5eebcf477fdcaa220b12..ba573ca2dfeaaf20dd9f21a5442acc01123d62d7 100644 (file)
@@ -100,7 +100,6 @@ count_leading_zeros_l (unsigned long int x)
   COUNT_LEADING_ZEROS (__builtin_clzl, _BitScanReverse, unsigned long int);
 }
 
-#if HAVE_UNSIGNED_LONG_LONG_INT
 /* Compute and return the number of leading zeros in X. */
 COUNT_LEADING_ZEROS_INLINE int
 count_leading_zeros_ll (unsigned long long int x)
@@ -108,7 +107,6 @@ count_leading_zeros_ll (unsigned long long int x)
   COUNT_LEADING_ZEROS (__builtin_clzll, _BitScanReverse64,
                        unsigned long long int);
 }
-#endif
 
 _GL_INLINE_HEADER_END
 
diff --git a/m4/count-leading-zeros.m4 b/m4/count-leading-zeros.m4
deleted file mode 100644 (file)
index efe31f9..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-# count-leading-zeros.m4 serial 2
-dnl Copyright (C) 2012-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_LEADING_ZEROS],
-[
-  dnl We don't need (and can't compile) count_leading_zeros_ll
-  dnl unless the type 'unsigned long long int' exists.
-  AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
-])
index f6ec283cd7a4efdb230a361e2d5707fc01b138ca..09a910d86276d5f6f9da0c1e84c1dc122ebd83a2 100644 (file)
@@ -4,14 +4,12 @@ Counts the number of leading 0-bits in a word.
 Files:
 lib/count-leading-zeros.c
 lib/count-leading-zeros.h
-m4/count-leading-zeros.m4
 
 Depends-on:
 extern-inline
 verify
 
 configure.ac:
-gl_COUNT_LEADING_ZEROS
 
 Makefile.am:
 lib_SOURCES += count-leading-zeros.c
index e94e37ef38c8306b0d048c5c3029982ea7e0821c..76f6f9637901de459ffe72b509a1a110f1687ee9 100644 (file)
@@ -68,10 +68,8 @@ main (int argc, char *argv[])
                             UINT_BIT, UINT_MAX, 1U);
   TEST_COUNT_LEADING_ZEROS (count_leading_zeros_l, unsigned long int,
                             ULONG_BIT, ULONG_MAX, 1UL);
-#ifdef HAVE_UNSIGNED_LONG_LONG_INT
   TEST_COUNT_LEADING_ZEROS (count_leading_zeros_ll, unsigned long long int,
                             ULLONG_BIT, ULLONG_MAX, 1ULL);
-#endif
 
   return 0;
 }