aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/check/crc_common.h
diff options
context:
space:
mode:
authorJia Tan <jiat0218@gmail.com>2024-01-22 21:36:09 +0800
committerJia Tan <jiat0218@gmail.com>2024-02-01 20:09:11 +0800
commit1940f0ec28f08c0ac72c1413d9706fb82eabe6ad (patch)
tree2df2dc8e2e9ea84e725b6b67b906f668c70eed64 /src/liblzma/check/crc_common.h
parentliblzma: Rename crc32_aarch64.h to crc32_arm64.h. (diff)
downloadxz-1940f0ec28f08c0ac72c1413d9706fb82eabe6ad.tar.xz
liblzma: Omit CRC tables when not needed with ARM64 optimizations.
This is similar to the existing x86-64 CLMUL conditions to omit the tables. They were slightly refactored to improve readability.
Diffstat (limited to 'src/liblzma/check/crc_common.h')
-rw-r--r--src/liblzma/check/crc_common.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/liblzma/check/crc_common.h b/src/liblzma/check/crc_common.h
index 35f60d95..123d7db0 100644
--- a/src/liblzma/check/crc_common.h
+++ b/src/liblzma/check/crc_common.h
@@ -75,6 +75,9 @@
// ARM64 CRC32 instruction is only useful for CRC32. Currently, only
// little endian is supported since we were unable to test on a big
// endian machine.
+//
+// NOTE: Keep this and the next check in sync with the macro
+// ARM64_CRC32_NO_TABLE in crc32_table.c
#if defined(HAVE_ARM64_CRC32) && !defined(WORDS_BIGENDIAN)
// Allow ARM64 CRC32 instruction without a runtime check if
// __ARM_FEATURE_CRC32 is defined. GCC and Clang only define this if the
@@ -94,7 +97,7 @@
// generic version can be omitted. Note that this doesn't work with MSVC
// as I don't know how to detect the features here.
//
-// NOTE: Keep this this in sync with crc32_table.c.
+// NOTE: Keep this in sync with the CLMUL_NO_TABLE macro in crc32_table.c.
# if (defined(__SSSE3__) && defined(__SSE4_1__) && defined(__PCLMUL__)) \
|| (defined(__e2k__) && __iset__ >= 6)
# define CRC32_ARCH_OPTIMIZED 1