File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -1941,9 +1941,10 @@ const StringMap<bool> sys::getHostCPUFeatures() {
19411941 }
19421942
19431943#if defined(__aarch64__)
1944- // If we have all crypto bits we can add the feature
1945- if (crypto == (CAP_AES | CAP_PMULL | CAP_SHA1 | CAP_SHA2))
1946- Features[" crypto" ] = true ;
1944+ // LLVM has decided some AArch64 CPUs have all the instructions they _may_
1945+ // have, as opposed to all the instructions they _must_ have, so allow runtime
1946+ // information to correct us on that.
1947+ Features[" crypto" ] = (crypto == (CAP_AES | CAP_PMULL | CAP_SHA1 | CAP_SHA2));
19471948#endif
19481949
19491950 return Features;
@@ -1952,12 +1953,13 @@ const StringMap<bool> sys::getHostCPUFeatures() {
19521953const StringMap<bool > sys::getHostCPUFeatures () {
19531954 StringMap<bool > Features;
19541955
1955- if (IsProcessorFeaturePresent (PF_ARM_NEON_INSTRUCTIONS_AVAILABLE))
1956- Features[" neon" ] = true ;
1957- if (IsProcessorFeaturePresent (PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE))
1958- Features[" crc" ] = true ;
1959- if (IsProcessorFeaturePresent (PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE))
1960- Features[" crypto" ] = true ;
1956+ // If we're asking the OS at runtime, believe what the OS says
1957+ Features[" neon" ] =
1958+ IsProcessorFeaturePresent (PF_ARM_NEON_INSTRUCTIONS_AVAILABLE);
1959+ Features[" crc" ] =
1960+ IsProcessorFeaturePresent (PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE);
1961+ Features[" crypto" ] =
1962+ IsProcessorFeaturePresent (PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE);
19611963
19621964 return Features;
19631965}
You can’t perform that action at this time.
0 commit comments