aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/check/crc_common.h
diff options
context:
space:
mode:
authorJia Tan <jiat0218@gmail.com>2023-10-14 10:23:03 +0800
committerJia Tan <jiat0218@gmail.com>2023-10-18 20:41:11 +0800
commita3ebc2c516b09616638060806c841bd4bcf7bce3 (patch)
treebaf6aec64d7b48ed3c0386a54a25cca0f242b59f /src/liblzma/check/crc_common.h
parentliblzma: Added crc32_clmul to crc32_fast.c. (diff)
downloadxz-a3ebc2c516b09616638060806c841bd4bcf7bce3.tar.xz
liblzma: Define CRC_USE_IFUNC in crc_common.h.
When ifunc is supported, we can define a simpler macro instead of repeating the more complex check in both crc32_fast.c and crc64_fast.c.
Diffstat (limited to '')
-rw-r--r--src/liblzma/check/crc_common.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/liblzma/check/crc_common.h b/src/liblzma/check/crc_common.h
index 867e53d9..55fdd55e 100644
--- a/src/liblzma/check/crc_common.h
+++ b/src/liblzma/check/crc_common.h
@@ -34,6 +34,7 @@
#undef CRC_GENERIC
#undef CRC_CLMUL
+#undef CRC_USE_IFUNC
#undef CRC_USE_GENERIC_FOR_SMALL_INPUTS
// If CLMUL cannot be used then only the generic slice-by-four is built.
@@ -54,6 +55,10 @@
# define CRC_GENERIC 1
# define CRC_CLMUL 1
+# ifdef HAVE_FUNC_ATTRIBUTE_IFUNC
+# define CRC_USE_IFUNC 1
+# endif
+
/*
// The generic code is much faster with 1-8-byte inputs and has
// similar performance up to 16 bytes at least in microbenchmarks