]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fix building with runtime CPU detection disabled
authorCameron Cawley <ccawley2011@gmail.com>
Wed, 9 Jul 2025 12:21:09 +0000 (13:21 +0100)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Wed, 9 Jul 2025 21:36:15 +0000 (23:36 +0200)
arch/arm/arm_functions.h
arch/generic/generic_functions.h
arch/s390/s390_functions.h
arch/x86/x86_functions.h

index 8d79d9d23b81bda3bbfb6dc3cf8ecaf0a7c595ff..b7b24f8838e3479fd2d3d845f37bb947cab6ae91 100644 (file)
@@ -39,6 +39,7 @@ void slide_hash_armv6(deflate_state *s);
 #  if (defined(ARM_NEON) && (defined(__ARM_NEON__) || defined(__ARM_NEON))) || ARM_NOCHECK_NEON
 #    undef native_adler32
 #    define native_adler32 adler32_neon
+#    undef native_adler32_fold_copy
 #    define native_adler32_fold_copy adler32_fold_copy_neon
 #    undef native_chunkmemset_safe
 #    define native_chunkmemset_safe chunkmemset_safe_neon
index 813d4f44a63928ce8b74092700be2e11020f0756..e2073b8f1022371f9e9303c25dcc28aa8f26195f 100644 (file)
@@ -52,7 +52,7 @@ void     slide_hash_c(deflate_state *s);
 #  define native_adler32_fold_copy adler32_fold_copy_c
 #  define native_chunkmemset_safe chunkmemset_safe_c
 #  define native_chunksize chunksize_c
-#  define native_crc32 PREFIX(crc32_c)
+#  define native_crc32 crc32_c
 #  define native_crc32_fold crc32_fold_c
 #  define native_crc32_fold_copy crc32_fold_copy_c
 #  define native_crc32_fold_final crc32_fold_final_c
index e6855cd7011cf48068fcc51a9c7018bc7092e932..2c43a50627fa1d9baefd47d792da2b89b0adc2d5 100644 (file)
@@ -20,7 +20,7 @@ uint32_t crc32_s390_vx(uint32_t crc, const uint8_t *buf, size_t len);
 #ifdef DISABLE_RUNTIME_CPU_DETECTION
 #  if defined(S390_CRC32_VX) && defined(__zarch__) && __ARCH__ >= 11 && defined(__VX__)
 #    undef native_crc32
-#    define native_crc32 crc32_s390_vx
+#    define native_crc32 crc32_s390_vx
 #  endif
 #endif
 
index 5e13ffe01b35eb25aff1f68c26e936bb8ed2ed94..9cf4b4313334af6734c182a9791abfdfa9275983 100644 (file)
@@ -115,7 +115,7 @@ uint32_t crc32_vpclmulqdq(uint32_t crc32, const uint8_t *buf, size_t len);
 #          define native_crc32 crc32_chorba_sse2
 #      endif
 #    endif
-#endif
+#  endif
 // X86 - SSSE3
 #  if defined(X86_SSSE3) && defined(__SSSE3__)
 #    undef native_adler32
@@ -125,30 +125,30 @@ uint32_t crc32_vpclmulqdq(uint32_t crc32, const uint8_t *buf, size_t len);
 #    undef native_inflate_fast
 #    define native_inflate_fast inflate_fast_ssse3
 #  endif
+// X86 - SSE4.1
 #  if !defined(WITHOUT_CHORBA) && defined(X86_SSE41) && defined(__SSE4_1__) && !defined(NO_CHORBA_SSE)
 #   undef native_crc32
 #   define native_crc32 crc32_chorba_sse41
-#   endif
+#  endif
 // X86 - SSE4.2
 #  if defined(X86_SSE42) && defined(__SSE4_2__)
 #    undef native_adler32_fold_copy
 #    define native_adler32_fold_copy adler32_fold_copy_sse42
 #  endif
-
 // X86 - PCLMUL
-#if defined(X86_PCLMULQDQ_CRC) && defined(__PCLMUL__)
-#  undef native_crc32
-#  define native_crc32 crc32_pclmulqdq
-#  undef native_crc32_fold
-#  define native_crc32_fold crc32_fold_pclmulqdq
-#  undef native_crc32_fold_copy
-#  define native_crc32_fold_copy crc32_fold_pclmulqdq_copy
-#  undef native_crc32_fold_final
-#  define native_crc32_fold_final crc32_fold_pclmulqdq_final
-#  undef native_crc32_fold_reset
-#  define native_crc32_fold_reset crc32_fold_pclmulqdq_reset
-#endif
-// X86 - AVX
+#  if defined(X86_PCLMULQDQ_CRC) && defined(__PCLMUL__)
+#    undef native_crc32
+#    define native_crc32 crc32_pclmulqdq
+#    undef native_crc32_fold
+#    define native_crc32_fold crc32_fold_pclmulqdq
+#    undef native_crc32_fold_copy
+#    define native_crc32_fold_copy crc32_fold_pclmulqdq_copy
+#    undef native_crc32_fold_final
+#    define native_crc32_fold_final crc32_fold_pclmulqdq_final
+#    undef native_crc32_fold_reset
+#    define native_crc32_fold_reset crc32_fold_pclmulqdq_reset
+#  endif
+// X86 - AVX2
 #  if defined(X86_AVX2) && defined(__AVX2__)
 #    undef native_adler32
 #    define native_adler32 adler32_avx2
@@ -171,7 +171,6 @@ uint32_t crc32_vpclmulqdq(uint32_t crc32, const uint8_t *buf, size_t len);
 #      define native_longest_match_slow longest_match_slow_avx2
 #    endif
 #  endif
-
 // X86 - AVX512 (F,DQ,BW,Vl)
 #  if defined(X86_AVX512) && defined(__AVX512F__) && defined(__AVX512DQ__) && defined(__AVX512BW__) && defined(__AVX512VL__)
 #    undef native_adler32