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=5928f9d94a48ef89e60c73d5fc258da7e16fc6d5;p=thirdparty%2Fzlib-ng.git Fix building with runtime CPU detection disabled Backport: Changes regarding Chorba removed --- 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 fc62daea..a5c2d58d 100644 --- a/arch/x86/x86_functions.h +++ b/arch/x86/x86_functions.h @@ -90,7 +90,7 @@ uint32_t crc32_vpclmulqdq(uint32_t crc32, const uint8_t *buf, size_t len); # undef native_longest_match_slow # define native_longest_match_slow longest_match_slow_sse2 # endif -#endif +# endif // X86 - SSSE3 # if defined(X86_SSSE3) && defined(__SSSE3__) # undef native_adler32 @@ -105,21 +105,20 @@ uint32_t crc32_vpclmulqdq(uint32_t crc32, const uint8_t *buf, size_t len); # 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 @@ -142,7 +141,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