From 849d0f282a6a890c5cf5a0e0f02980b12d9ebb0f Mon Sep 17 00:00:00 2001 From: Chenxi Mao Date: Tue, 9 Jan 2024 17:23:11 +0800 Subject: Speed up CRC32 calculation on ARM64 The CRC32 instructions in ARM64 can calculate the CRC32 result for 8 bytes in a single operation, making the use of ARM64 instructions much faster compared to the general CRC32 algorithm. Optimized CRC32 will be enabled if ARM64 has CRC extension running on Linux. Signed-off-by: Chenxi Mao --- src/liblzma/check/crc32_fast.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/liblzma/check/crc32_fast.c') diff --git a/src/liblzma/check/crc32_fast.c b/src/liblzma/check/crc32_fast.c index cf7d75da..07d5afb1 100644 --- a/src/liblzma/check/crc32_fast.c +++ b/src/liblzma/check/crc32_fast.c @@ -15,9 +15,12 @@ #include "check.h" #include "crc_common.h" -#ifdef CRC_X86_CLMUL +#if defined(CRC_X86_CLMUL) # define BUILDING_CRC32_CLMUL # include "crc_x86_clmul.h" +#elif defined(CRC32_ARM64) +# define BUILDING_CRC32_AARCH64 +# include "crc32_aarch64.h" #endif -- cgit v1.2.3