File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 120120 ret
121121.size _armv8_sve2_probe,.-_armv8_sve2_probe
122122
123+ .globl _armv8_sve_get_vl_bytes
124+ .type _armv8_sve_get_vl_bytes,%function
125+ _armv8_sve_get_vl_bytes:
126+ AARCH64_VALID_CALL_TARGET
127+ .inst 0x0420e3e0 // cntb x0
128+ ret
129+ .size _armv8_sve_get_vl_bytes,.-_armv8_sve_get_vl_bytes
130+
123131.globl _armv8_cpuid_probe
124132.type _armv8_cpuid_probe,%function
125133_armv8_cpuid_probe:
Original file line number Diff line number Diff line change @@ -211,6 +211,7 @@ void _armv8_eor3_probe(void);
211211void _armv8_sve_probe (void );
212212void _armv8_sve2_probe (void );
213213void _armv8_rng_probe (void );
214+ unsigned long _armv8_sve_get_vl_bytes (void );
214215# endif
215216# endif /* !__APPLE__ && !OSSL_IMPLEMENT_GETAUXVAL */
216217
@@ -445,9 +446,10 @@ void OPENSSL_cpuid_setup(void)
445446 MIDR_IS_CPU_MODEL (OPENSSL_arm_midr , ARM_CPU_IMP_QCOMM , QCOM_CPU_PART_ORYON_X1 )) &&
446447 (OPENSSL_armcap_P & ARMV8_SHA3 ))
447448 OPENSSL_armcap_P |= ARMV8_HAVE_SHA3_AND_WORTH_USING ;
448- if ((OPENSSL_armcap_P & ARMV8_SVE2 ) != 0
449- && ( e = getenv ( "OPENSSL_SVE2_POLY1305" )) != NULL && atoi ( e ) != 0 )
449+ if ((OPENSSL_armcap_P & ARMV8_SVE2 ) && ( _armv8_sve_get_vl_bytes () > 16 )) {
450+ // This implementation faster if vector length > 128 bits
450451 OPENSSL_armcap_P |= ARMV8_SVE2_POLY1305 ;
452+ }
451453# endif
452454}
453455#endif /* _WIN32, __ARM_MAX_ARCH__ >= 7 */
You can’t perform that action at this time.
0 commit comments