File tree 1 file changed +7
-9
lines changed
1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -1967,21 +1967,19 @@ bool sys::getHostCPUFeatures(StringMap<bool> &Features) {
1967
1967
}
1968
1968
1969
1969
#if defined(__aarch64__)
1970
- // If we have all crypto bits we can add the feature
1971
- if (crypto == (CAP_AES | CAP_PMULL | CAP_SHA1 | CAP_SHA2))
1972
- Features[" crypto" ] = true ;
1970
+ // LLVM has decided some AArch64 CPUs have all the instructions they _may_ have, as opposed to
1971
+ // all the instructions they _must_ have, so allow runtime information to correct us on that.
1972
+ Features[" crypto" ] = (crypto == (CAP_AES | CAP_PMULL | CAP_SHA1 | CAP_SHA2)) ;
1973
1973
#endif
1974
1974
1975
1975
return true ;
1976
1976
}
1977
1977
#elif defined(_WIN32) && (defined(__aarch64__) || defined(_M_ARM64))
1978
1978
bool sys::getHostCPUFeatures (StringMap<bool > &Features) {
1979
- if (IsProcessorFeaturePresent (PF_ARM_NEON_INSTRUCTIONS_AVAILABLE))
1980
- Features[" neon" ] = true ;
1981
- if (IsProcessorFeaturePresent (PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE))
1982
- Features[" crc" ] = true ;
1983
- if (IsProcessorFeaturePresent (PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE))
1984
- Features[" crypto" ] = true ;
1979
+ // If we're asking the OS at runtime, believe what the OS says
1980
+ Features[" neon" ] = IsProcessorFeaturePresent (PF_ARM_NEON_INSTRUCTIONS_AVAILABLE);
1981
+ Features[" crc" ] = IsProcessorFeaturePresent (PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE);
1982
+ Features[" crypto" ] = IsProcessorFeaturePresent (PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE);
1985
1983
1986
1984
return true ;
1987
1985
}
You can’t perform that action at this time.
0 commit comments