summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2017-03-13 05:55:15 +0100
committerYuri Kunde Schlesner <yuriks@yuriks.net>2017-03-13 05:55:15 +0100
commit6ca816e011c03f90f9ef6800c747c030df54c0cf (patch)
treed6b5bd5974690ac082de6cee73d69d952e45344e
parentMerge pull request #2614 from Schplee/patch-1 (diff)
downloadyuzu-6ca816e011c03f90f9ef6800c747c030df54c0cf.tar
yuzu-6ca816e011c03f90f9ef6800c747c030df54c0cf.tar.gz
yuzu-6ca816e011c03f90f9ef6800c747c030df54c0cf.tar.bz2
yuzu-6ca816e011c03f90f9ef6800c747c030df54c0cf.tar.lz
yuzu-6ca816e011c03f90f9ef6800c747c030df54c0cf.tar.xz
yuzu-6ca816e011c03f90f9ef6800c747c030df54c0cf.tar.zst
yuzu-6ca816e011c03f90f9ef6800c747c030df54c0cf.zip
-rw-r--r--src/common/x64/cpu_detect.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/common/x64/cpu_detect.cpp b/src/common/x64/cpu_detect.cpp
index 370ae2c80..2cb3ab9cc 100644
--- a/src/common/x64/cpu_detect.cpp
+++ b/src/common/x64/cpu_detect.cpp
@@ -8,9 +8,9 @@
#include "common/common_types.h"
#include "cpu_detect.h"
-namespace Common {
-
-#ifndef _MSC_VER
+#ifdef _MSC_VER
+#include <intrin.h>
+#else
#if defined(__DragonFly__) || defined(__FreeBSD__)
// clang-format off
@@ -37,13 +37,15 @@ static inline void __cpuid(int info[4], int function_id) {
}
#define _XCR_XFEATURE_ENABLED_MASK 0
-static u64 _xgetbv(u32 index) {
+static inline u64 _xgetbv(u32 index) {
u32 eax, edx;
__asm__ __volatile__("xgetbv" : "=a"(eax), "=d"(edx) : "c"(index));
return ((u64)edx << 32) | eax;
}
-#endif // ifndef _MSC_VER
+#endif // _MSC_VER
+
+namespace Common {
// Detects the various CPU features
static CPUCaps Detect() {