diff options
author | Jack Lloyd <[email protected]> | 2021-04-21 17:37:03 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2021-04-21 17:37:03 -0400 |
commit | 225727ec8d5c057f8b9d419ca90904df0bb9feee (patch) | |
tree | 9b29f9c4a4ba4ce30347db1a9e1ebb0af921a573 /src/lib | |
parent | 39c49b9d317584e5183ffa99fb6c33c997ce6869 (diff) | |
parent | f7add2ae44b4f90d65c69911c5e69f52fccc0a06 (diff) |
Merge GH #2721 Add SHA-512 ARMv8 detection using SIGILL approach
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/utils/cpuid/cpuid_aarch64.cpp | 3 |
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 |