From: Adam Stylinski Date: Thu, 28 Nov 2024 19:05:32 +0000 (-0500) Subject: Fix native detection of CRC instruction X-Git-Tag: 2.2.3~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=785444de0800a99234bcf223e553622133f588a9;p=thirdparty%2Fzlib-ng.git Fix native detection of CRC instruction 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. --- diff --git a/arch/arm/arm_functions.h b/arch/arm/arm_functions.h index 2b38e665..b256c37b 100644 --- a/arch/arm/arm_functions.h +++ b/arch/arm/arm_functions.h @@ -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