diff options
author | Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> | 2015-08-09 07:06:52 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2015-08-09 07:06:52 +0000 |
commit | 5bfac9d653357c906946563b9494d7ae69cdad92 (patch) | |
tree | 0cc119af894a398497eba6f56fe2f224f6947616 /src/corelib/tools/qsimd.cpp | |
parent | f08e1ecdc88e9373a31c1505d5db7f905431c644 (diff) | |
parent | 77da617dc8e378a631ee8c15b1b414f16b87f147 (diff) |
Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/dev
Diffstat (limited to 'src/corelib/tools/qsimd.cpp')
-rw-r--r-- | src/corelib/tools/qsimd.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp index d572dd209c..e7917ffdac 100644 --- a/src/corelib/tools/qsimd.cpp +++ b/src/corelib/tools/qsimd.cpp @@ -36,6 +36,10 @@ #include <QByteArray> #include <stdio.h> +#ifdef Q_OS_LINUX +# include "../testlib/3rdparty/valgrind_p.h" +#endif + #if defined(Q_OS_WIN) # if defined(Q_OS_WINCE) # include <qt_windows.h> @@ -256,8 +260,12 @@ static inline uint detectProcessorFeatures() uint features = 0; int cpuidLevel = maxBasicCpuidSupported(); +#if Q_PROCESSOR_X86 < 5 if (cpuidLevel < 1) return 0; +#else + Q_ASSERT(cpuidLevel >= 1); +#endif uint cpuid01ECX = 0, cpuid01EDX = 0; cpuidFeatures01(cpuid01ECX, cpuid01EDX); @@ -497,8 +505,7 @@ static const int features_indices[] = { static const int features_count = (sizeof features_indices - 1) / (sizeof features_indices[0]); // record what CPU features were enabled by default in this Qt build -// don't define for HLE, since the HLE prefix can be run on older CPUs -static const uint minFeature = qCompilerCpuFeatures & ~HLE; +static const uint minFeature = qCompilerCpuFeatures; #ifdef Q_OS_WIN #if defined(Q_CC_GNU) @@ -554,7 +561,12 @@ void qDetectCpuFeatures() } } - if (minFeature != 0 && (f & minFeature) != minFeature) { +#ifdef RUNNING_ON_VALGRIND + bool runningOnValgrind = RUNNING_ON_VALGRIND; +#else + bool runningOnValgrind = false; +#endif + if (!runningOnValgrind && (minFeature != 0 && (f & minFeature) != minFeature)) { uint missing = minFeature & ~f; fprintf(stderr, "Incompatible processor. This Qt build requires the following features:\n "); for (int i = 0; i < features_count; ++i) { |