I merged this now, thank you!

I added another patch (attached) to make the decision to use the
slice-by-8 implementation a maintainer option rather than something
visible to end-users.  That also fixes the ./configure stdout output,
you forgot the corresponding AC_MSG_RESULT to the AC_MSG_CHECKING.  I
don't think it makes sense for normal users to be exposed to this fairly
internal implementation choice.  The slice-by-8 implementation is now
the default, and maintainers who wish to disable it for projects that
are really low on memory can add gl_DISABLE_CRC_SLICE_BY_8 early on in
configure.ac.  Advanced users can disable it with `gl_crc_slice_by_8=no
./configure' too.  I expect this to be exceptionally rare, although I do
have a use-case for this myself so I appreciate this being configurable.

Can you build gzip with an updated gnulib and compare speed?  And run
the self-test suite too, to add some assurance we didn't mess up
anything.

A next step would be to evaluate if the assembler CRC instructions help
further on some platforms...

/Simon
From cc3fb685ac370a368cb84480117be13d109eebf0 Mon Sep 17 00:00:00 2001
From: Simon Josefsson <si...@josefsson.org>
Date: Thu, 31 Oct 2024 13:10:34 +0100
Subject: [PATCH] crc: make it a maintainer setting rather than a user setting.

* m4/crc.m4 (gl_CRC_SLICE_BY_8): Drop AC_ARG_ENABLE.
---
 ChangeLog |  5 +++++
 m4/crc.m4 | 23 +++++++++++++----------
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 42367f8135..b0719c23bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-10-31  Simon Josefsson  <si...@josefsson.org>
+
+	crc: make it a maintainer setting rather than a user setting.
+	* m4/crc.m4 (gl_CRC_SLICE_BY_8): Drop AC_ARG_ENABLE.
+
 2024-10-27  Sam Russell  <sam.h.russ...@gmail.com>
 
 	crc: New optimised slice-by-8 implementation
diff --git a/m4/crc.m4 b/m4/crc.m4
index 0007b7274e..f62987e78e 100644
--- a/m4/crc.m4
+++ b/m4/crc.m4
@@ -1,22 +1,25 @@
 # crc.m4
-# serial 3
-dnl Copyright (C) 2024-2024 Free Software Foundation, Inc.
+# serial 4
+dnl Copyright (C) 2024 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.
 dnl This file is offered as-is, without any warranty.
 
+# For use by maintainer's after gl_EARLY in configure.ac.
+AC_DEFUN([gl_DISABLE_CRC_SLICE_BY_8],
+[
+  gl_crc_slice_by_8=no
+])
+
 AC_DEFUN([gl_CRC_SLICE_BY_8],
 [
   AC_MSG_CHECKING([whether to enable CRC slice-by-8 algorithm])
-  AC_ARG_ENABLE([crc-slice-by-8],
-    [AS_HELP_STRING([[--disable-crc-slice-by-8]],
-       [disable CRC slice-by-8 algorithm])],
-    [enable_crc_slice_by_8=$enableval],
-    [enable_crc_slice_by_8=yes])
-
-  if test $enable_crc_slice_by_8 = yes; then
+  if test x"$gl_crc_slice_by_8" != x"no"; then
+      AC_MSG_RESULT([yes])
       AC_DEFINE([GL_CRC_SLICE_BY_8], [1],
-      [Define to get faster but larger CRC32 operation.])
+                [Define to get faster but larger CRC32 operation.])
+  else
+      AC_MSG_RESULT([no])
   fi
 ])
-- 
2.46.0

Attachment: signature.asc
Description: PGP signature

Reply via email to