]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Enable AES and SHA3 optimisations on Apple Silicon M5-based macOS systems
authorTom Cosgrove <tom.cosgrove@arm.com>
Thu, 30 Oct 2025 11:01:33 +0000 (11:01 +0000)
committerTomas Mraz <tomas@openssl.org>
Wed, 19 Nov 2025 14:54:00 +0000 (15:54 +0100)
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 <paul.dale@oracle.com>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29053)

crypto/armcap.c

index afbfb377dd8d46fc1c547bf18e7a0dbe1bccd6cd..7eeea93bd11a3600ad95c1aeb048c4a53920c945 100644 (file)
@@ -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;
             }