diff options
author | Everton Constantino <everton.constantino@linaro.org> | 2022-10-27 15:07:48 -0300 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2022-11-24 06:37:39 +0000 |
commit | 0703f3f9dff447a98cba53a06278ba8c82d466ce (patch) | |
tree | 55edc8f452a942c2cd8f116c03353a03634e59a3 /crypto/armcap.c | |
parent | bf8365842f27ebb7cbef3b24903248011b1574d9 (diff) |
Add two new build targets to enable the possibility of using clang-cl as
an assembler for Windows on Arm builds and also clang-cl as the compiler
as well. Make appropriate changes to armcap source and peralsm scripts.
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19523)
(cherry picked from commit b863e1e4c69068e4166bdfbbf9f04bb07991dd40)
Diffstat (limited to 'crypto/armcap.c')
-rw-r--r-- | crypto/armcap.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/crypto/armcap.c b/crypto/armcap.c index 0aa11baed4..a43f17304b 100644 --- a/crypto/armcap.c +++ b/crypto/armcap.c @@ -17,15 +17,36 @@ #include <sys/sysctl.h> #endif #include "internal/cryptlib.h" +#ifndef _WIN32 #include <unistd.h> - +#else +#include <windows.h> +#endif #include "arm_arch.h" unsigned int OPENSSL_armcap_P = 0; unsigned int OPENSSL_arm_midr = 0; unsigned int OPENSSL_armv8_rsa_neonized = 0; -#if __ARM_MAX_ARCH__<7 +#ifdef _WIN32 +void OPENSSL_cpuid_setup(void) +{ + OPENSSL_armcap_P |= ARMV7_NEON; + OPENSSL_armv8_rsa_neonized = 1; + if (IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE)) { + // These are all covered by one call in Windows + OPENSSL_armcap_P |= ARMV8_AES; + OPENSSL_armcap_P |= ARMV8_PMULL; + OPENSSL_armcap_P |= ARMV8_SHA1; + OPENSSL_armcap_P |= ARMV8_SHA256; + } +} + +uint32_t OPENSSL_rdtsc(void) +{ + return 0; +} +#elif __ARM_MAX_ARCH__<7 void OPENSSL_cpuid_setup(void) { } |