]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
liblzma: CRC: Update CLMUL comments to more generic wording.
authorLasse Collin <lasse.collin@tukaani.org>
Thu, 11 Jan 2024 12:39:46 +0000 (14:39 +0200)
committerLasse Collin <lasse.collin@tukaani.org>
Thu, 11 Jan 2024 12:39:46 +0000 (14:39 +0200)
src/liblzma/check/crc32_fast.c
src/liblzma/check/crc64_fast.c

index 7157e2f49f9b9f4bfd2a063140713bef58fffb01..cf7d75dafd92107a1ad3125a85e3ddd363c37f0b 100644 (file)
@@ -93,10 +93,10 @@ crc32_generic(const uint8_t *buf, size_t size, uint32_t crc)
 // Function dispatching //
 //////////////////////////
 
-// If both the generic and CLMUL implementations are built, then the
-// function to use is selected at runtime since system running the
-// binary may not have the CLMUL instructions.
-// The three dispatch methods in order of priority:
+// If both the generic and arch-optimized implementations are built, then
+// the function to use is selected at runtime because the system running
+// the binary might not have the arch-specific instruction set extension(s)
+// available. The three dispatch methods in order of priority:
 //
 // 1. Indirect function (ifunc). This method is slightly more efficient
 //    than the constructor method because it will change the entry in the
@@ -195,10 +195,10 @@ extern LZMA_API(uint32_t)
 lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc)
 {
 #if defined(CRC_GENERIC) && defined(CRC_ARCH_OPTIMIZED)
-       // If CLMUL is available, it is the best for non-tiny inputs,
-       // being over twice as fast as the generic slice-by-four version.
-       // However, for size <= 16 it's different. In the extreme case
-       // of size == 1 the generic version can be five times faster.
+       // On x86-64, if CLMUL is available, it is the best for non-tiny
+       // inputs, being over twice as fast as the generic slice-by-four
+       // version. However, for size <= 16 it's different. In the extreme
+       // case of size == 1 the generic version can be five times faster.
        // At size >= 8 the CLMUL starts to become reasonable. It
        // varies depending on the alignment of buf too.
        //
index 4edca1a2b81688e8fd00c736ffd73a9c222afe72..eb1a4ae4e7677181951a6febc283277fb040269f 100644 (file)
@@ -88,8 +88,8 @@ crc64_generic(const uint8_t *buf, size_t size, uint64_t crc)
 // Function dispatching //
 //////////////////////////
 
-// If both the generic and CLMUL implementations are usable, then the
-// function that is used is selected at runtime. See crc32_fast.c.
+// If both the generic and arch-optimized implementations are usable, then
+// the function that is used is selected at runtime. See crc32_fast.c.
 
 typedef uint64_t (*crc64_func_type)(
                const uint8_t *buf, size_t size, uint64_t crc);
@@ -160,9 +160,9 @@ lzma_crc64(const uint8_t *buf, size_t size, uint64_t crc)
        return crc64_func(buf, size, crc);
 
 #elif defined(CRC_ARCH_OPTIMIZED)
-       // If CLMUL is used unconditionally without runtime CPU detection
-       // then omitting the generic version and its 8 KiB lookup table
-       // makes the library smaller.
+       // If arch-optimized version is used unconditionally without runtime
+       // CPU detection then omitting the generic version and its 8 KiB
+       // lookup table makes the library smaller.
        //
        // FIXME: Lookup table isn't currently omitted on 32-bit x86,
        // see crc64_table.c.