[PATCH] D68139: [Support, ARM64] Define getHostCPUFeatures for Windows on ARM64 platform

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 2 04:08:36 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rG353ac42ce2f2: [Support, ARM64] Define getHostCPUFeatures for Windows on ARM64 platform (authored by mstorsjo).
Herald added a subscriber: hiraditya.

Changed prior to commit:
  https://reviews.llvm.org/D68139?vs=222762&id=222797#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68139/new/

https://reviews.llvm.org/D68139

Files:
  llvm/lib/Support/Host.cpp


Index: llvm/lib/Support/Host.cpp
===================================================================
--- llvm/lib/Support/Host.cpp
+++ llvm/lib/Support/Host.cpp
@@ -1512,6 +1512,17 @@
 
   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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68139.222797.patch
Type: text/x-patch
Size: 755 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191002/27360bfc/attachment.bin>


More information about the llvm-commits mailing list