Commit ebe5dcf0 by Tibor Dusnoki Committed by Alexis Hétu

Define getHostCPUFeatures for Windows on ARM64 platform

This change implements getHostCPUFeatures function to enable this functionality on Windows on ARM64. This was committed to llvm at https://reviews.llvm.org/D68139 . Bug: chromium:893460 Change-Id: I7ae62f298683979a4ab1aa8099d6e91706b15c9b Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/37328 Presubmit-Ready: Alexis Hétu <sugoi@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Tested-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 520ed228
...@@ -1358,6 +1358,17 @@ bool sys::getHostCPUFeatures(StringMap<bool> &Features) { ...@@ -1358,6 +1358,17 @@ bool sys::getHostCPUFeatures(StringMap<bool> &Features) {
return true; return true;
} }
#elif defined(_WIN32) && (defined(__aarch64__) || defined(_M_ARM64))
bool sys::getHostCPUFeatures(StringMap<bool> &Features) {
if (IsProcessorFeaturePresent(PF_ARM_NEON_INSTRUCTIONS_AVAILABLE))
Features["neon"] = true;
if (IsProcessorFeaturePresent(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE))
Features["crc"] = true;
if (IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE))
Features["crypto"] = true;
return true;
}
#else #else
bool sys::getHostCPUFeatures(StringMap<bool> &Features) { return false; } bool sys::getHostCPUFeatures(StringMap<bool> &Features) { return false; }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment