summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qsimd.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2013-05-20 14:53:14 -0700
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-04 18:33:02 +0200
commit76d75fd7df66c2687cf78945ccead03c5500f531 (patch)
treedfd41dc6506877b08c5a33ffb9fb86cda2942635 /src/corelib/tools/qsimd.cpp
parentc11a7d16c7056da4086a87c9e85b89f8466be032 (diff)
Use the GCC inline assembly when building for MinGW
MinGW has a longstanding problem of providing the MSVC intrinsics that every Windows developer expects to be there. Other projects have run into those problems. So instead just use the GCC inline assembly. Change-Id: I5651f97f9a4dfbf98ebbf063f91f221eab80b224 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/tools/qsimd.cpp')
-rw-r--r--src/corelib/tools/qsimd.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp
index 97a64eb5bb..c81df7a6f2 100644
--- a/src/corelib/tools/qsimd.cpp
+++ b/src/corelib/tools/qsimd.cpp
@@ -240,14 +240,14 @@ inline quint64 _xgetbv(__int64) { return 0; }
#endif
static void xgetbv(uint in, uint &eax, uint &edx)
{
-#ifdef Q_OS_WIN
- quint64 result = _xgetbv(in);
- eax = result;
- edx = result >> 32;
-#elif defined(Q_CC_GNU)
+#if defined(Q_CC_GNU)
asm (".byte 0x0F, 0x01, 0xD0" // xgetbv instruction
: "=a" (eax), "=d" (edx)
: "c" (in));
+#elif defined(Q_OS_WIN)
+ quint64 result = _xgetbv(in);
+ eax = result;
+ edx = result >> 32;
#endif
}