From: Tom Cosgrove Date: Thu, 30 Oct 2025 11:01:33 +0000 (+0000) Subject: Enable AES and SHA3 optimisations on Apple Silicon M5-based macOS systems X-Git-Tag: 4.0-PRE-CLANG-FORMAT-WEBKIT~162 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b810d9256b3adbf558517f4fd7ee2d2c5464746;p=thirdparty%2Fopenssl.git Enable AES and SHA3 optimisations on Apple Silicon M5-based macOS systems ARMV8_UNROLL8_EOR3 gives a performance improvement of 6-35%. ARMV8_HAVE_SHA3_AND_WORTH_USING gives 3-4% improvement. Still no performance gain from ARMV8_UNROLL12_EOR3. Change-Id: I692ad5711e7ff728cd59baba64830cd3f69c3687 Reviewed-by: Paul Dale Reviewed-by: Norbert Pocs Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/29053) --- diff --git a/crypto/armcap.c b/crypto/armcap.c index afbfb377dd8..7eeea93bd11 100644 --- a/crypto/armcap.c +++ b/crypto/armcap.c @@ -297,7 +297,8 @@ void OPENSSL_cpuid_setup(void) ((strncmp(uarch, "Apple M1", 8) == 0) || (strncmp(uarch, "Apple M2", 8) == 0) || (strncmp(uarch, "Apple M3", 8) == 0) || - (strncmp(uarch, "Apple M4", 8) == 0))) { + (strncmp(uarch, "Apple M4", 8) == 0) || + (strncmp(uarch, "Apple M5", 8) == 0))) { OPENSSL_armcap_P |= ARMV8_UNROLL8_EOR3; OPENSSL_armcap_P |= ARMV8_HAVE_SHA3_AND_WORTH_USING; }