aboutsummaryrefslogtreecommitdiffstats
path: root/alc/cpu_caps.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-11-16 12:42:33 -0800
committerChris Robinson <[email protected]>2020-11-16 12:42:33 -0800
commit1869dc14d498be4dbe771a898b995ae6eb372083 (patch)
treef70c105db75e78a44049d0f31e2d8fda31f07c02 /alc/cpu_caps.cpp
parenta494a89c5afe7ec8fd1077101c524bc995f0367e (diff)
Use WinAPI functions to check for NEON support
Diffstat (limited to 'alc/cpu_caps.cpp')
-rw-r--r--alc/cpu_caps.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/alc/cpu_caps.cpp b/alc/cpu_caps.cpp
index a480f77b..ab6c2d4b 100644
--- a/alc/cpu_caps.cpp
+++ b/alc/cpu_caps.cpp
@@ -3,6 +3,14 @@
#include "cpu_caps.h"
+#if defined(_WIN32) && (defined(_M_ARM) || defined(_M_ARM64))
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#ifndef PF_ARM_NEON_INSTRUCTIONS_AVAILABLE
+#define PF_ARM_NEON_INSTRUCTIONS_AVAILABLE 19
+#endif
+#endif
+
#ifdef HAVE_INTRIN_H
#include <intrin.h>
#endif
@@ -105,6 +113,9 @@ void FillCPUCaps(int capfilter)
#ifdef HAVE_NEON
#ifdef __ARM_NEON
caps |= CPU_CAP_NEON;
+#elif defined(_WIN32) && (defined(_M_ARM) || defined(_M_ARM64))
+ if(IsProcessorFeaturePresent(PF_ARM_NEON_INSTRUCTIONS_AVAILABLE))
+ caps |= CPU_CAP_NEON;
#else
al::ifstream file{"/proc/cpuinfo"};
if(!file.is_open())