From: Cameron Cawley Date: Wed, 9 Jul 2025 12:21:09 +0000 (+0100) Subject: Fix building with runtime CPU detection disabled X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f891bd399d4026db9b465396e7be0117d481ef20;p=thirdparty%2Fzlib-ng.git Fix building with runtime CPU detection disabled --- diff --git a/arch/arm/arm_functions.h b/arch/arm/arm_functions.h index 8d79d9d2..b7b24f88 100644 --- a/arch/arm/arm_functions.h +++ b/arch/arm/arm_functions.h @@ -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 diff --git a/arch/generic/generic_functions.h b/arch/generic/generic_functions.h index 813d4f44..e2073b8f 100644 --- a/arch/generic/generic_functions.h +++ b/arch/generic/generic_functions.h @@ -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 diff --git a/arch/s390/s390_functions.h b/arch/s390/s390_functions.h index e6855cd7..2c43a506 100644 --- a/arch/s390/s390_functions.h +++ b/arch/s390/s390_functions.h @@ -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 diff --git a/arch/x86/x86_functions.h b/arch/x86/x86_functions.h index 5e13ffe0..9cf4b431 100644 --- a/arch/x86/x86_functions.h +++ b/arch/x86/x86_functions.h @@ -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