]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
cksum: update to pclmul optimized crc32b from gnulib
authorPádraig Brady <P@draigBrady.com>
Wed, 18 Dec 2024 12:39:47 +0000 (12:39 +0000)
committerPádraig Brady <P@draigBrady.com>
Fri, 20 Dec 2024 14:47:54 +0000 (14:47 +0000)
* bootstrap.conf: Depend on crc-x86_64 rather than crc.
* gnulib: Update to latest.
* src/cksum.c (crc32b_sum_stream): Add --debug info.
* NEWS: Mention the performance improvement.

NEWS
bootstrap.conf
gnulib
src/cksum.c

diff --git a/NEWS b/NEWS
index ed87546937ee86d0d3ae68c6e5afb8b661ab9ea5..332e862d60b282a6d3a051fefaf6489c8f07cf89 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -54,6 +54,7 @@ GNU coreutils NEWS                                    -*- outline -*-
 
   cksum -a now supports the "crc32b" option, which calculates the CRC
   of the input as defined by ITU V.42, as used by gzip for example.
+  For performance pclmul instructions are used where supported.
 
   ls now supports the --sort=name option,
   to explicitly select the default operation of sorting by file name.
index 480e029310a9b5a4311611bd4b513f9e124d83c7..e10c1ac54155d414eca2ba029109f374b7a772ea 100644 (file)
@@ -64,7 +64,7 @@ gnulib_modules="
   config-h
   configmake
   copy-file-range
-  crc
+  crc-x86_64
   crypto/md5
   crypto/sha1
   crypto/sha256
diff --git a/gnulib b/gnulib
index 1f36fee699926dbd04d4b97ca19fad29a847c3ae..da6b90f1fd041c013b9685ec4256e16d75b83f5d 160000 (submodule)
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 1f36fee699926dbd04d4b97ca19fad29a847c3ae
+Subproject commit da6b90f1fd041c013b9685ec4256e16d75b83f5d
index 489af7e52dc00a55128b878bbd65a516ed5c5e64..dd6d0aab4d61fc96743de05439a01f8aa1d22428 100644 (file)
@@ -149,7 +149,7 @@ static bool
 pclmul_supported (void)
 {
   bool pclmul_enabled = false;
-# if USE_PCLMUL_CRC32
+# if USE_PCLMUL_CRC32 || GL_CRC_X86_64_PCLMUL
   pclmul_enabled = (0 < __builtin_cpu_supports ("pclmul")
                     && 0 < __builtin_cpu_supports ("avx"));
 
@@ -332,6 +332,11 @@ crc32b_sum_stream (FILE *stream, void *resstream, uintmax_t *reslen)
   if (!stream || !resstream || !reslen)
     return -1;
 
+# if GL_CRC_X86_64_PCLMUL
+  if (cksum_debug)
+    (void) pclmul_supported ();
+# endif
+
   while ((bytes_read = fread (buf, 1, BUFLEN, stream)) > 0)
     {
       if (len + bytes_read < len)