aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/opts/opts_check_SSE2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/opts/opts_check_SSE2.cpp')
-rw-r--r--src/opts/opts_check_SSE2.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/opts/opts_check_SSE2.cpp b/src/opts/opts_check_SSE2.cpp
index 16dbcff2df..a839696a66 100644
--- a/src/opts/opts_check_SSE2.cpp
+++ b/src/opts/opts_check_SSE2.cpp
@@ -14,6 +14,10 @@
#include "SkUtils_opts_SSE2.h"
#include "SkUtils.h"
+#if defined(_MSC_VER) && defined(_WIN64)
+#include <intrin.h>
+#endif
+
/* This file must *not* be compiled with -msse or -msse2, otherwise
gcc may generate sse2 even for scalar ops (and thus give an invalid
instruction on Pentium3 on the code below). Only files named *_SSE2.cpp
@@ -22,6 +26,9 @@
#ifdef _MSC_VER
static inline void getcpuid(int info_type, int info[4]) {
+#if defined(_WIN64)
+ __cpuid(info, info_type);
+#else
__asm {
mov eax, [info_type]
cpuid
@@ -31,6 +38,7 @@ static inline void getcpuid(int info_type, int info[4]) {
mov [edi+8], ecx
mov [edi+12], edx
}
+#endif
}
#else
#if defined(__x86_64__)