From 6a653e66dbff544a305c49758342280429d4b7e7 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Wed, 2 Oct 2019 11:04:55 +0000 Subject: [PATCH] [Support, ARM64] Define getHostCPUFeatures for Windows on ARM64 platform Patch by Adam Kallai! Differential Revision: https://reviews.llvm.org/D68139 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373445 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/Host.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/Support/Host.cpp b/lib/Support/Host.cpp index 5509ec00886..2a473a1994c 100644 --- a/lib/Support/Host.cpp +++ b/lib/Support/Host.cpp @@ -1512,6 +1512,17 @@ bool sys::getHostCPUFeatures(StringMap &Features) { return true; } +#elif defined(_WIN32) && (defined(__aarch64__) || defined(_M_ARM64)) +bool sys::getHostCPUFeatures(StringMap &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 &Features) { return false; } #endif -- 2.40.0