]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fix native detection of CRC instruction
authorAdam Stylinski <kungfujesus06@gmail.com>
Thu, 28 Nov 2024 19:05:32 +0000 (14:05 -0500)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sun, 1 Dec 2024 15:05:15 +0000 (16:05 +0100)
It's unclear if raspberry pi OS's shipped GCC doesn't properly detect
ACLE or not (/proc/cpuinfo claims to support AES), but in any case, the
preprocessor macro for that flag is not defined with -march=native on a
raspberry pi 5. Unfortunately that means when built "WITH_NATIVE", we do
not get a fast CRC function.  The CRC32 preprocessor macro _IS_ defined,
and the auto detection when built without NATIVE support does properly
get dispatched to. Since we only need the scalar CRC32 and not the polynomial
stuff anyhow, let's make it be an || condition and not a && one.

arch/arm/arm_functions.h

index 2b38e665e9b8bda78ddeeb6092580f26abe0cb07..b256c37bff84f9541d50a79db0f56834e1e8889f 100644 (file)
@@ -56,7 +56,7 @@ void slide_hash_armv6(deflate_state *s);
 #    endif
 #  endif
 // ARM - ACLE
-#  if defined(ARM_ACLE) && defined(__ARM_ACLE) && defined(__ARM_FEATURE_CRC32)
+#  if defined(ARM_ACLE) && (defined(__ARM_ACLE) || defined(__ARM_FEATURE_CRC32))
 #    undef native_crc32
 #    define native_crc32 crc32_acle
 #  endif