]> 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-git@circlestorm.org>
Sat, 26 Jul 2025 18:51:47 +0000 (20:51 +0200)
Backport: Changes regarding Chorba removed

arch/s390/s390_functions.h
arch/x86/x86_functions.h

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 fc62daeae15af6f1ef44b0d6731f8f7296b090b4..a5c2d58da7124bc40b2457c4c77538daf24d81e9 100644 (file)
@@ -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