]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Disable CRC32-VX Extention for some Clang versions
authorEduard Stefes <eduard.stefes@ibm.com>
Tue, 21 Jan 2025 09:48:07 +0000 (10:48 +0100)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sat, 25 Jan 2025 16:25:17 +0000 (17:25 +0100)
We have to disable the CRC32-VX implementation for some Clang versions
(18 <= version < 19.1.2) that generate bad code for the IBM S390 VGFMA intrinsics.

arch/s390/s390_functions.h

index e9c67978f0a0372199058f901b5cfb3facdcf29d..e6855cd7011cf48068fcc51a9c7018bc7092e932 100644 (file)
@@ -7,8 +7,15 @@
 
 #ifdef S390_CRC32_VX
 uint32_t crc32_s390_vx(uint32_t crc, const uint8_t *buf, size_t len);
+
+#ifdef __clang__
+#  if ((__clang_major__ == 18) || (__clang_major__ == 19 && (__clang_minor__ < 1 || (__clang_minor__ == 1 && __clang_patchlevel__ < 2))))
+# error CRC32-VX optimizations are broken due to compiler bug in Clang versions: 18.0.0 <= clang_version < 19.1.2. \
+        Either disable the zlib-ng CRC32-VX optimization, or switch to another compiler/compiler version.
+#  endif
 #endif
 
+#endif
 
 #ifdef DISABLE_RUNTIME_CPU_DETECTION
 #  if defined(S390_CRC32_VX) && defined(__zarch__) && __ARCH__ >= 11 && defined(__VX__)