summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qsimd.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-09-08 11:20:47 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-09-08 17:32:10 (GMT)
commit4c0e59e6ad6b697a28f7c57540fb2eb0042d04d0 (patch)
treead7f652e5f9c6fa3a27b00b402f3aebadeb54ea3 /src/corelib/tools/qsimd.cpp
parent13192187f96554277ffdae40f5117682041b3556 (diff)
downloadQt-4c0e59e6ad6b697a28f7c57540fb2eb0042d04d0.zip
Qt-4c0e59e6ad6b697a28f7c57540fb2eb0042d04d0.tar.gz
Qt-4c0e59e6ad6b697a28f7c57540fb2eb0042d04d0.tar.bz2
Work around a compiler bug on 64-bit.
Some GCC versions seem to think that the EBX register is the PIC register even on 64-bit. So instead of telling GCC that we clobbered it, save it instead on a temporary register. Reviewed-by: Trust Me
Diffstat (limited to 'src/corelib/tools/qsimd.cpp')
-rw-r--r--src/corelib/tools/qsimd.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp
index a9c33f1..7babf3a 100644
--- a/src/corelib/tools/qsimd.cpp
+++ b/src/corelib/tools/qsimd.cpp
@@ -286,10 +286,13 @@ static inline uint detectProcessorFeatures()
uint feature_result = 0;
#if defined(Q_CC_GNU)
- asm ("cpuid"
- : "=c" (feature_result)
+ long tmp;
+ asm ("xchg %%rbx, %1\n"
+ "cpuid\n"
+ "xchg %%rbx, %1\n"
+ : "=c" (feature_result), "=&r" (tmp)
: "a" (1)
- : "%ebx", "%edx"
+ : "%edx"
);
#elif defined (Q_OS_WIN64)
{