diff options
author | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2010-07-28 10:40:30 (GMT) |
---|---|---|
committer | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2010-07-28 10:50:13 (GMT) |
commit | 26b46c24f4b8dcac6f55cb01b53187be53389e4b (patch) | |
tree | 4d7c301a2fcbb1a698eaeefd0f55334a292be90f | |
parent | 75f5b49b9a722c5f3827ea538e13a69dff1d8c78 (diff) | |
download | Qt-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
-rw-r--r-- | src/corelib/tools/qsimd.cpp | 33 |
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 |