aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils/cpuid
diff options
context:
space:
mode:
authorDavid CARLIER <[email protected]>2021-04-20 20:53:51 +0100
committerDavid CARLIER <[email protected]>2021-04-20 20:53:51 +0100
commitf7add2ae44b4f90d65c69911c5e69f52fccc0a06 (patch)
tree8cae915724f2a92fe63615b84b813444ce884c27 /src/lib/utils/cpuid
parent1c5043bdfaf94919626eb38019571bb6f26a91fd (diff)
cpuid arm64, sigill detection probing via sha512su0 instruction.
Diffstat (limited to 'src/lib/utils/cpuid')
-rw-r--r--src/lib/utils/cpuid/cpuid_aarch64.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/utils/cpuid/cpuid_aarch64.cpp b/src/lib/utils/cpuid/cpuid_aarch64.cpp
index 7f17db2a9..af42c621e 100644
--- a/src/lib/utils/cpuid/cpuid_aarch64.cpp
+++ b/src/lib/utils/cpuid/cpuid_aarch64.cpp
@@ -117,6 +117,7 @@ uint64_t CPUID::CPUID_Data::detect_cpu_features(size_t* cache_line_size)
auto pmull_probe = []() noexcept -> int { asm(".word 0x0ee0e000"); return 1; };
auto sha1_probe = []() noexcept -> int { asm(".word 0x5e280800"); return 1; };
auto sha2_probe = []() noexcept -> int { asm(".word 0x5e282800"); return 1; };
+ auto sha512_probe = []() noexcept -> int { asm(".long 0xcec08000"); return 1; };
// Only bother running the crypto detection if we found NEON
@@ -132,6 +133,8 @@ uint64_t CPUID::CPUID_Data::detect_cpu_features(size_t* cache_line_size)
detected_features |= CPUID::CPUID_ARM_SHA1_BIT;
if(OS::run_cpu_instruction_probe(sha2_probe) == 1)
detected_features |= CPUID::CPUID_ARM_SHA2_BIT;
+ if(OS::run_cpu_instruction_probe(sha512_probe) == 1)
+ detected_features |= CPUID::CPUID_ARM_SHA2_512_BIT;
}
#endif