summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qsimd.cpp
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2010-07-28 10:40:30 (GMT)
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2010-07-28 10:50:13 (GMT)
commit26b46c24f4b8dcac6f55cb01b53187be53389e4b (patch)
tree4d7c301a2fcbb1a698eaeefd0f55334a292be90f /src/corelib/tools/qsimd.cpp
parent75f5b49b9a722c5f3827ea538e13a69dff1d8c78 (diff)
downloadQt-26b46c24f4b8dcac6f55cb01b53187be53389e4b.zip
Qt-26b46c24f4b8dcac6f55cb01b53187be53389e4b.tar.gz
Qt-26b46c24f4b8dcac6f55cb01b53187be53389e4b.tar.bz2
Fix compilation on 64-bit Windows.
When compiling for 64-bit with Visual Studio 2008, inline assembly is not supported. Use intrisic instead. Reviewed-by: Benjamin Poulain
Diffstat (limited to 'src/corelib/tools/qsimd.cpp')
-rw-r--r--src/corelib/tools/qsimd.cpp33
1 files changed, 8 insertions, 25 deletions
diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp
index 5aa7217..8005d7d 100644
--- a/src/corelib/tools/qsimd.cpp
+++ b/src/corelib/tools/qsimd.cpp
@@ -46,6 +46,10 @@
#include <windows.h>
#endif
+#if defined(Q_OS_WIN64) && !defined(Q_CC_GNU)
+#include <intrin.h>
+#endif
+
QT_BEGIN_NAMESPACE
uint qDetectCPUFeatures()
@@ -261,31 +265,10 @@ uint qDetectCPUFeatures()
: "%eax", "%ecx", "%edx"
);
#elif defined (Q_OS_WIN64)
- _asm {
- push rax
- push rbx
- push rcx
- push rdx
- pushfd
- pop rax
- mov ebx, eax
- xor eax, 00200000h
- push rax
- popfd
- pushfd
- pop rax
- mov edx, 0
- xor eax, ebx
- jz skip
-
- mov eax, 1
- cpuid
- mov feature_result, ecx
- skip:
- pop rdx
- pop rcx
- pop rbx
- pop rax
+ {
+ int info[4];
+ __cpuid(info, 1);
+ feature_result = info[2];
}
#endif