arch/generic/chunkset_c.c
arch/generic/compare256_c.c
arch/generic/crc32_braid_c.c
+ arch/generic/crc32_chorba_c.c
arch/generic/slide_hash_c.c
)
add_definitions(-DWITH_ALL_FALLBACKS)
endif()
-if(WITH_CRC32_CHORBA)
- list(APPEND ZLIB_SRCS arch/generic/crc32_chorba_c.c)
-endif()
-
if(WITH_RUNTIME_CPU_DETECTION)
list(APPEND ZLIB_PRIVATE_HDRS cpu_features.h)
list(APPEND ZLIB_SRCS cpu_features.c)
arch/generic/chunkset_c.o \
arch/generic/compare256_c.o \
arch/generic/crc32_braid_c.o \
+ arch/generic/crc32_chorba_c.o \
arch/generic/slide_hash_c.o \
adler32.o \
compress.o \
trees.o \
uncompr.o \
zutil.o \
- arch/generic/crc32_chorba_c.o \
cpu_features.o \
$(ARCH_STATIC_OBJS)
arch/generic/chunkset_c.lo \
arch/generic/compare256_c.lo \
arch/generic/crc32_braid_c.lo \
+ arch/generic/crc32_chorba_c.lo \
arch/generic/slide_hash_c.lo \
adler32.lo \
compress.lo \
trees.lo \
uncompr.lo \
zutil.lo \
- arch/generic/crc32_chorba_c.lo \
cpu_features.lo \
$(ARCH_SHARED_OBJS)
#include "zbuild.h"
#include "arch_functions.h"
-#if defined(X86_SSE2) && !defined(WITHOUT_CHORBA_SSE) && defined(CRC32_CHORBA_FALLBACK)
+#if defined(X86_SSE2) && defined(CRC32_CHORBA_SSE_FALLBACK)
#include "crc32_chorba_p.h"
#include "crc32_braid_p.h"
len -= align_diff;
buf += align_diff;
}
-#if !defined(WITHOUT_CHORBA)
+#ifdef CRC32_CHORBA_FALLBACK
if (len > CHORBA_LARGE_THRESHOLD)
return crc32_chorba_118960_nondestructive(crc, buf, len);
#endif
#include "zbuild.h"
#include "arch_functions.h"
-#if defined(X86_SSE41) && !defined(WITHOUT_CHORBA_SSE) && defined(CRC32_CHORBA_FALLBACK)
+#if defined(X86_SSE41) && defined(CRC32_CHORBA_SSE_FALLBACK)
#include "crc32_chorba_p.h"
#include "crc32_braid_p.h"
len -= align_diff;
buf += align_diff;
}
-#if !defined(WITHOUT_CHORBA)
+#ifdef CRC32_CHORBA_FALLBACK
if (len > CHORBA_LARGE_THRESHOLD)
return crc32_chorba_118960_nondestructive(crc, buf, len);
#endif
#include "x86_natives.h"
+#if !defined(X86_PCLMULQDQ_NATIVE) && !defined(X86_VPCLMULQDQ_NATIVE)
+# define CRC32_BRAID_FALLBACK
+# ifndef WITHOUT_CHORBA_SSE
+# define CRC32_CHORBA_SSE_FALLBACK
+# endif
+#endif
+
#ifdef X86_SSE2
uint8_t* chunkmemset_safe_sse2(uint8_t *out, uint8_t *from, size_t len, size_t left);
uint32_t compare256_sse2(const uint8_t *src0, const uint8_t *src1);
uint32_t longest_match_roll_sse2(deflate_state *const s, uint32_t cur_match);
void slide_hash_sse2(deflate_state *s);
-# if !defined(WITHOUT_CHORBA) && !defined(WITHOUT_CHORBA_SSE)
+# ifdef CRC32_CHORBA_SSE_FALLBACK
uint32_t crc32_chorba_sse2(uint32_t crc, const uint8_t *buf, size_t len);
uint32_t crc32_copy_chorba_sse2(uint32_t crc, uint8_t *dst, const uint8_t *src, size_t len);
uint32_t chorba_small_nondestructive_sse2(uint32_t crc, const uint8_t *buf, size_t len);
#endif
#if defined(X86_SSE41)
-# if !defined(WITHOUT_CHORBA) && !defined(WITHOUT_CHORBA_SSE)
+# ifdef CRC32_CHORBA_SSE_FALLBACK
uint32_t crc32_chorba_sse41(uint32_t crc, const uint8_t *buf, size_t len);
uint32_t crc32_copy_chorba_sse41(uint32_t crc, uint8_t *dst, const uint8_t *src, size_t len);
# endif
uint32_t crc32_copy_vpclmulqdq_avx512(uint32_t crc, uint8_t *dst, const uint8_t *src, size_t len);
#endif
-#if !defined(X86_PCLMULQDQ_NATIVE) && !defined(X86_VPCLMULQDQ_NATIVE)
-# define CRC32_BRAID_FALLBACK
-#endif
-
#ifdef DISABLE_RUNTIME_CPU_DETECTION
// X86 - SSE2
# ifdef X86_SSE2_NATIVE
# define native_longest_match longest_match_sse2
# undef native_longest_match_roll
# define native_longest_match_roll longest_match_roll_sse2
-# if !defined(WITHOUT_CHORBA) && !defined(WITHOUT_CHORBA_SSE)
+# ifdef CRC32_CHORBA_SSE_FALLBACK
# undef native_crc32
# define native_crc32 crc32_chorba_sse2
# undef native_crc32_copy
# endif
// X86 - SSE4.1
# if defined(X86_SSE41_NATIVE)
-# if !defined(WITHOUT_CHORBA) && !defined(WITHOUT_CHORBA_SSE)
+# ifdef CRC32_CHORBA_SSE_FALLBACK
# undef native_crc32
# define native_crc32 crc32_chorba_sse41
# undef native_crc32_copy
ft.longest_match_roll = &longest_match_roll_sse2;
ft.slide_hash = &slide_hash_sse2;
# endif
-# if !defined(WITHOUT_CHORBA_SSE) && !defined(X86_PCLMULQDQ_NATIVE)
+# if defined(CRC32_CHORBA_SSE_FALLBACK) && !defined(X86_SSE41_NATIVE) && !defined(X86_PCLMULQDQ_NATIVE)
ft.crc32 = &crc32_chorba_sse2;
ft.crc32_copy = &crc32_copy_chorba_sse2;
# endif
if (cf.x86.has_sse41)
# endif
{
-# ifndef WITHOUT_CHORBA_SSE
+# ifdef CRC32_CHORBA_SSE_FALLBACK
ft.crc32 = &crc32_chorba_sse41;
ft.crc32_copy = &crc32_copy_chorba_sse41;
# endif
BENCHMARK_CRC32(native, native_crc32, 1);
#else
-#if defined(CRC32_CHORBA_FALLBACK) && !defined(WITHOUT_CHORBA_SSE)
+#ifdef CRC32_CHORBA_SSE_FALLBACK
# ifdef X86_SSE2
BENCHMARK_CRC32(chorba_sse2, crc32_chorba_sse2, test_cpu_features.x86.has_sse2);
# endif
BENCHMARK_CRC32_COPY(native, native_crc32, native_crc32_copy, 1)
#else
// Optimized functions
-# if defined(CRC32_CHORBA_FALLBACK) && !defined(WITHOUT_CHORBA_SSE)
+# ifdef CRC32_CHORBA_SSE_FALLBACK
# ifdef X86_SSE2
BENCHMARK_CRC32_COPY(chorba_sse2, crc32_chorba_sse2, crc32_copy_chorba_sse2, test_cpu_features.x86.has_sse2);
# endif
#ifdef X86_VPCLMULQDQ_AVX512
TEST_CRC32(vpclmulqdq_avx512, crc32_vpclmulqdq_avx512, (test_cpu_features.x86.has_pclmulqdq && test_cpu_features.x86.has_avx512_common && test_cpu_features.x86.has_vpclmulqdq))
#endif
-#if defined(CRC32_CHORBA_FALLBACK) && !defined(WITHOUT_CHORBA_SSE)
+#ifdef CRC32_CHORBA_SSE_FALLBACK
# ifdef X86_SSE2
TEST_CRC32(chorba_sse2, crc32_chorba_sse2, test_cpu_features.x86.has_sse2)
# endif
TEST_CRC32_COPY(native, native_crc32_copy, 1)
#else
// Optimized functions
-# if defined(CRC32_CHORBA_FALLBACK) && !defined(WITHOUT_CHORBA_SSE)
+# ifdef CRC32_CHORBA_SSE_FALLBACK
# ifdef X86_SSE2
TEST_CRC32_COPY(chorba_sse2, crc32_copy_chorba_sse2, test_cpu_features.x86.has_sse2)
# endif