]> granicus.if.org Git - llvm/commitdiff
[Support, ARM64] Define getHostCPUFeatures for Windows on ARM64 platform
authorMartin Storsjo <martin@martin.st>
Wed, 2 Oct 2019 11:04:55 +0000 (11:04 +0000)
committerMartin Storsjo <martin@martin.st>
Wed, 2 Oct 2019 11:04:55 +0000 (11:04 +0000)
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

index 5509ec008862710fc1b065f8a71e8628104534a3..2a473a1994c2b0cbebf7dd34b59f2897e1cb7359 100644 (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