diff options
author | Jia Tan <jiat0218@gmail.com> | 2024-01-22 20:49:30 +0800 |
---|---|---|
committer | Jia Tan <jiat0218@gmail.com> | 2024-02-01 20:09:11 +0800 |
commit | 455a08609caa3223066a717fb01bfa42c5dba47d (patch) | |
tree | a693bbb9237ad28a04e6ed29af6bf3037c40bac4 /src/liblzma/check/crc32_fast.c | |
parent | CMake: Add support for ARM64 CRC32 instruction detection. (diff) | |
download | xz-455a08609caa3223066a717fb01bfa42c5dba47d.tar.xz |
liblzma: Refactor crc_common.h.
The CRC_GENERIC is now split into CRC32_GENERIC and CRC64_GENERIC, since
the ARM64 optimizations will be different between CRC32 and CRC64.
For the same reason, CRC_ARCH_OPTIMIZED is split into
CRC32_ARCH_OPTIMIZED and CRC64_ARCH_OPTIMIZED.
ifunc will only be used with x86-64 CLMUL because the runtime detection
methods needed with ARM64 are not compatible with ifunc.
Diffstat (limited to 'src/liblzma/check/crc32_fast.c')
-rw-r--r-- | src/liblzma/check/crc32_fast.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/liblzma/check/crc32_fast.c b/src/liblzma/check/crc32_fast.c index 07d5afb1..be034bdc 100644 --- a/src/liblzma/check/crc32_fast.c +++ b/src/liblzma/check/crc32_fast.c @@ -24,7 +24,7 @@ #endif -#ifdef CRC_GENERIC +#ifdef CRC32_GENERIC /////////////////// // Generic CRC32 // @@ -90,7 +90,7 @@ crc32_generic(const uint8_t *buf, size_t size, uint32_t crc) #endif -#if defined(CRC_GENERIC) && defined(CRC_ARCH_OPTIMIZED) +#if defined(CRC32_GENERIC) && defined(CRC32_ARCH_OPTIMIZED) ////////////////////////// // Function dispatching // @@ -197,7 +197,7 @@ lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc) extern LZMA_API(uint32_t) lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc) { -#if defined(CRC_GENERIC) && defined(CRC_ARCH_OPTIMIZED) +#if defined(CRC32_GENERIC) && defined(CRC32_ARCH_OPTIMIZED) // On x86-64, if CLMUL is available, it is the best for non-tiny // inputs, being over twice as fast as the generic slice-by-four // version. However, for size <= 16 it's different. In the extreme @@ -229,7 +229,7 @@ lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc) */ return crc32_func(buf, size, crc); -#elif defined(CRC_ARCH_OPTIMIZED) +#elif defined(CRC32_ARCH_OPTIMIZED) return crc32_arch_optimized(buf, size, crc); #else |