diff options
author | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2010-07-28 10:40:30 (GMT) |
---|---|---|
committer | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2010-08-10 13:17:59 (GMT) |
commit | dd2a5c1556cf29fac03ae789dd5c43f482011d68 (patch) | |
tree | f83cdebb356356fe5626033dc83bbceb6d7cca8b | |
parent | 0650ec9effe5d9dd643d1bc19d2af591244671d4 (diff) | |
download | Qt-dd2a5c1556cf29fac03ae789dd5c43f482011d68.zip Qt-dd2a5c1556cf29fac03ae789dd5c43f482011d68.tar.gz Qt-dd2a5c1556cf29fac03ae789dd5c43f482011d68.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 |