xz/src/liblzma/check
Lasse Collin f644473a21 liblzma: Add fast CRC64 for 32/64-bit x86 using SSSE3 + SSE4.1 + CLMUL.
It also works on E2K as it supports these intrinsics.

On x86-64 runtime detection is used so the code keeps working on
older processors too. A CLMUL-only build can be done by using
-msse4.1 -mpclmul in CFLAGS and this will reduce the library
size since the generic implementation and its 8 KiB lookup table
will be omitted.

On 32-bit x86 this isn't used by default for now because by default
on 32-bit x86 the separate assembly file crc64_x86.S is used.
If --disable-assembler is used then this new CLMUL code is used
the same way as on 64-bit x86. However, a CLMUL-only build
(-msse4.1 -mpclmul) won't omit the 8 KiB lookup table on
32-bit x86 due to a currently-missing check for disabled
assembler usage.

The configure.ac check should be such that the code won't be
built if something in the toolchain doesn't support it but
--disable-clmul-crc option can be used to unconditionally
disable this feature.

CLMUL speeds up decompression of files that have compressed very
well (assuming CRC64 is used as a check type). It is know that
the CLMUL code is significantly slower than the generic code for
tiny inputs (especially 1-8 bytes but up to 16 bytes). If that
is a real-world problem then there is already a commented-out
variant that uses the generic version for small inputs.

Thanks to Ilya Kurdyukov for the original patch which was
derived from a white paper from Intel [1] (published in 2009)
and public domain code from [2] (released in 2016).

[1] https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/fast-crc-computation-generic-polynomials-pclmulqdq-paper.pdf
[2] https://github.com/rawrunprotected/crc
2022-11-14 23:05:46 +02:00
..
Makefile.inc liblzma: Try to use SHA-256 from the operating system. 2011-05-21 15:08:44 +03:00
check.c Use a tuklib module for integer handling. 2009-10-04 22:57:12 +03:00
check.h liblzma: Disable external SHA-256 by default. 2016-03-13 20:21:49 +02:00
crc32_fast.c Rename read32ne to aligned_read32ne, and similarly for the others. 2019-12-31 00:29:48 +02:00
crc32_small.c liblzma: Use __attribute__((__constructor__)) if available. 2022-11-14 16:00:52 +02:00
crc32_table.c liblzma: Silence clang -Wmissing-variable-declarations. 2019-06-24 23:45:21 +03:00
crc32_table_be.h Regenerate the CRC tables without trailing blanks. 2009-01-26 20:09:17 +02:00
crc32_table_le.h Regenerate the CRC tables without trailing blanks. 2009-01-26 20:09:17 +02:00
crc32_tablegen.c Use a tuklib module for integer handling. 2009-10-04 22:57:12 +03:00
crc32_x86.S liblzma: Use non-executable stack on FreeBSD as on Linux 2022-02-22 01:23:34 +02:00
crc64_fast.c liblzma: Add fast CRC64 for 32/64-bit x86 using SSSE3 + SSE4.1 + CLMUL. 2022-11-14 23:05:46 +02:00
crc64_small.c liblzma: Use __attribute__((__constructor__)) if available. 2022-11-14 16:00:52 +02:00
crc64_table.c liblzma: Add fast CRC64 for 32/64-bit x86 using SSSE3 + SSE4.1 + CLMUL. 2022-11-14 23:05:46 +02:00
crc64_table_be.h Regenerate the CRC tables without trailing blanks. 2009-01-26 20:09:17 +02:00
crc64_table_le.h Regenerate the CRC tables without trailing blanks. 2009-01-26 20:09:17 +02:00
crc64_tablegen.c Use a tuklib module for integer handling. 2009-10-04 22:57:12 +03:00
crc64_x86.S liblzma: Use non-executable stack on FreeBSD as on Linux 2022-02-22 01:23:34 +02:00
crc_macros.h Use a tuklib module for integer handling. 2009-10-04 22:57:12 +03:00
sha256.c liblzma: SHA-256: Optimize the Maj macro slightly. 2014-08-03 21:32:25 +03:00