liblzma: CRC: Update CLMUL comments to more generic wording.

This commit is contained in:
Lasse Collin 2024-01-11 14:39:46 +02:00
parent 66f080e801
commit 35c03ec6bf
2 changed files with 13 additions and 13 deletions

View File

@ -93,10 +93,10 @@ crc32_generic(const uint8_t *buf, size_t size, uint32_t crc)
// Function dispatching // // Function dispatching //
////////////////////////// //////////////////////////
// If both the generic and CLMUL implementations are built, then the // If both the generic and arch-optimized implementations are built, then
// function to use is selected at runtime since system running the // the function to use is selected at runtime because the system running
// binary may not have the CLMUL instructions. // the binary might not have the arch-specific instruction set extension(s)
// The three dispatch methods in order of priority: // available. The three dispatch methods in order of priority:
// //
// 1. Indirect function (ifunc). This method is slightly more efficient // 1. Indirect function (ifunc). This method is slightly more efficient
// than the constructor method because it will change the entry in the // 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) lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc)
{ {
#if defined(CRC_GENERIC) && defined(CRC_ARCH_OPTIMIZED) #if defined(CRC_GENERIC) && defined(CRC_ARCH_OPTIMIZED)
// If CLMUL is available, it is the best for non-tiny inputs, // On x86-64, if CLMUL is available, it is the best for non-tiny
// being over twice as fast as the generic slice-by-four version. // inputs, being over twice as fast as the generic slice-by-four
// However, for size <= 16 it's different. In the extreme case // version. However, for size <= 16 it's different. In the extreme
// of size == 1 the generic version can be five times faster. // case of size == 1 the generic version can be five times faster.
// At size >= 8 the CLMUL starts to become reasonable. It // At size >= 8 the CLMUL starts to become reasonable. It
// varies depending on the alignment of buf too. // varies depending on the alignment of buf too.
// //

View File

@ -88,8 +88,8 @@ crc64_generic(const uint8_t *buf, size_t size, uint64_t crc)
// Function dispatching // // Function dispatching //
////////////////////////// //////////////////////////
// If both the generic and CLMUL implementations are usable, then the // If both the generic and arch-optimized implementations are usable, then
// function that is used is selected at runtime. See crc32_fast.c. // the function that is used is selected at runtime. See crc32_fast.c.
typedef uint64_t (*crc64_func_type)( typedef uint64_t (*crc64_func_type)(
const uint8_t *buf, size_t size, uint64_t crc); 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); return crc64_func(buf, size, crc);
#elif defined(CRC_ARCH_OPTIMIZED) #elif defined(CRC_ARCH_OPTIMIZED)
// If CLMUL is used unconditionally without runtime CPU detection // If arch-optimized version is used unconditionally without runtime
// then omitting the generic version and its 8 KiB lookup table // CPU detection then omitting the generic version and its 8 KiB
// makes the library smaller. // lookup table makes the library smaller.
// //
// FIXME: Lookup table isn't currently omitted on 32-bit x86, // FIXME: Lookup table isn't currently omitted on 32-bit x86,
// see crc64_table.c. // see crc64_table.c.