[Support, ARM64] Define getHostCPUFeatures for Windows on ARM64 platform

Patch by Adam Kallai!

Differential Revision: https://reviews.llvm.org/D68139

llvm-svn: 373445
This commit is contained in:
Martin Storsjo 2019-10-02 11:04:55 +00:00
parent d44fc23abd
commit 353ac42ce2
1 changed files with 11 additions and 0 deletions

View File

@ -1512,6 +1512,17 @@ bool sys::getHostCPUFeatures(StringMap<bool> &Features) {
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
bool sys::getHostCPUFeatures(StringMap<bool> &Features) { return false; }
#endif