diff options
author | Jan-Arve Saether <jan-arve.saether@nokia.com> | 2012-05-16 14:34:14 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-19 01:45:04 +0200 |
commit | 55d7e5f18bb321981edef0cb02fdad5b5ad0bd0a (patch) | |
tree | 24a0f9b16de5f428826fee53c0bdc84c523b5f5b /src/corelib/tools/qsimd.cpp | |
parent | c01621ec8849123214ac9bcd9e38b572037917f8 (diff) |
Compile fix: Do not rely on __cpuidex() for msvc2008
Since its hard to detect if __cpuidex() is actually available at
compile time, we'll add a function overload that will be chosen if the
intrinsic __cpuidex() is not available.
Note that the QtXgetbvHack that was used for _xgetbv did not really
work (MS compiler will bail out because of ambiguous overloads if the
intrinsic _xgetbv existed).
Therefore, we apply the same workaround for _xgetbv.
Change-Id: Iee3bf8bc6352ba0861b05d779f1f001d4eb013ff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qsimd.cpp')
-rw-r--r-- | src/corelib/tools/qsimd.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp index ac21e5beb9..821de8d3ee 100644 --- a/src/corelib/tools/qsimd.cpp +++ b/src/corelib/tools/qsimd.cpp @@ -212,6 +212,10 @@ static void cpuidFeatures01(uint &ecx, uint &edx) #endif } +#ifdef Q_OS_WIN +inline void __cpuidex(int info[4], int, __int64) { memset(info, 0, 4*sizeof(int));} +#endif + static void cpuidFeatures07_00(uint &ebx) { #if defined(Q_CC_GNU) @@ -231,10 +235,7 @@ static void cpuidFeatures07_00(uint &ebx) } #ifdef Q_OS_WIN -namespace QtXgetbvHack { - inline quint64 _xgetbv(int) { return 0; } -} -using namespace QtXgetbvHack; +inline quint64 _xgetbv(__int64) { return 0; } #endif static void xgetbv(int in, uint &eax, uint &edx) |