From f9f4082ab60749a7b56c323fcc60f83257726427 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 3 Apr 2015 11:22:30 -0700 Subject: [PATCH] Don't complain about missing CPU features under Valgrind If you're running Qt under valgrind, it stands to reason that you know what you're doing. In particular, Valgrind does support AVX and AVX2 instructions, but some versions seem to be missing the necessary CPUID bits. Change-Id: I9a75ad8521ae4e5cbbe5ffff13d1940f6fa5c4f4 Reviewed-by: Olivier Goffart (Woboq GmbH) Reviewed-by: David Faure --- src/corelib/tools/qsimd.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp index 52ffc161bf..4973da9cb1 100644 --- a/src/corelib/tools/qsimd.cpp +++ b/src/corelib/tools/qsimd.cpp @@ -36,6 +36,10 @@ #include #include +#ifdef Q_OS_LINUX +# include "../testlib/3rdparty/valgrind_p.h" +#endif + #if defined(Q_OS_WIN) # if defined(Q_OS_WINCE) # include @@ -552,7 +556,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) {