From 26b46c24f4b8dcac6f55cb01b53187be53389e4b Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Wed, 28 Jul 2010 12:40:30 +0200 Subject: 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 --- src/corelib/tools/qsimd.cpp | 33 ++++++++------------------------- 1 file 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 #endif +#if defined(Q_OS_WIN64) && !defined(Q_CC_GNU) +#include +#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 -- cgit v0.12