summaryrefslogtreecommitdiffstats
path: root/crypto/armcap.c
diff options
context:
space:
mode:
authorJiangning Liu <jiangning.liu@amperecomputing.com>2024-03-22 00:52:28 +0100
committerTomas Mraz <tomas@openssl.org>2024-04-08 11:54:29 +0200
commite7f1afe4f7e799394684ce86bd98f2445031eb7f (patch)
tree31bce6208bc2e86d6a408fa0da73c9293aa0eef3 /crypto/armcap.c
parentNonStop: Do not call sleep() with a 0 value (diff)
downloadopenssl-e7f1afe4f7e799394684ce86bd98f2445031eb7f.tar.xz
openssl-e7f1afe4f7e799394684ce86bd98f2445031eb7f.zip
Enable SHA3 unrolling and EOR3 optimization for Ampere
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/23929)
Diffstat (limited to '')
-rw-r--r--crypto/armcap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/armcap.c b/crypto/armcap.c
index bbb9f454fc..afd3e9083e 100644
--- a/crypto/armcap.c
+++ b/crypto/armcap.c
@@ -419,11 +419,13 @@ void OPENSSL_cpuid_setup(void)
if ((MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_ARM, ARM_CPU_PART_V1) ||
MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_ARM, ARM_CPU_PART_N2) ||
MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_MICROSOFT, MICROSOFT_CPU_PART_COBALT_100) ||
- MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_ARM, ARM_CPU_PART_V2)) &&
+ MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_ARM, ARM_CPU_PART_V2) ||
+ MIDR_IMPLEMENTER(OPENSSL_arm_midr) == ARM_CPU_IMP_AMPERE) &&
(OPENSSL_armcap_P & ARMV8_SHA3))
OPENSSL_armcap_P |= ARMV8_UNROLL8_EOR3;
if ((MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_ARM, ARM_CPU_PART_V1) ||
- MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_ARM, ARM_CPU_PART_V2)) &&
+ MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_ARM, ARM_CPU_PART_V2) ||
+ MIDR_IMPLEMENTER(OPENSSL_arm_midr) == ARM_CPU_IMP_AMPERE) &&
(OPENSSL_armcap_P & ARMV8_SHA3))
OPENSSL_armcap_P |= ARMV8_UNROLL12_EOR3;
if ((MIDR_IS_CPU_MODEL(OPENSSL_arm_midr, ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_FIRESTORM) ||