diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2018-06-20 15:20:32 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2018-07-09 00:18:27 +0000 |
commit | 5219c37f7c98f37f078fee00fe8ca35d83ff4f5d (patch) | |
tree | b1d8264e2fe35b22fd5bd3363d6c07342bcc8f1a /src/corelib/plugin/qfactoryloader.cpp | |
parent | c3a4ec5d0bbd5f2710f4fd1d3bd4a2d7f0f507ad (diff) |
QLibrary: find AVX2 (Haswell) optimized plugins and libraries
Libraries are placed in a subdir "haswell/" of the main library dir,
whereas plugins are simply named with ".avx2" appended to the plugin
name (plugin.so.avx2). The "haswell/" library directory suffix is a
convention found in glibc since version 2.26, whereas the ".avx2" and
".avx512" suffixes are a convention found in the Clear Linux OS for
Intel Architecture.
This patch implements this for all Unix OSes, except for Darwin, where
the fat file format already has a sub-architecture for Haswell
(x86_64h).
We could also implement the "sse2/" subdir search for libraries, but I
don't think it's worth the cost in 2018.
Change-Id: Iff4151c519c144d580c4fffd1539fe5ee9a4d7b1
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/plugin/qfactoryloader.cpp')
-rw-r--r-- | src/corelib/plugin/qfactoryloader.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp index a40ba575fd..ec6d98cc3c 100644 --- a/src/corelib/plugin/qfactoryloader.cpp +++ b/src/corelib/plugin/qfactoryloader.cpp @@ -133,6 +133,11 @@ void QFactoryLoader::update() // versions of the same Qt libraries (due to the plugin's dependencies). if (isDebugPlugin != isDebugLibrary) continue; +#elif defined(Q_PROCESSOR_X86) + if (fileName.endsWith(QLatin1String(".avx2")) || fileName.endsWith(QLatin1String(".avx512"))) { + // ignore AVX2-optimized file, we'll do a bait-and-switch to it later + continue; + } #endif if (qt_debug_component()) { qDebug() << "QFactoryLoader::QFactoryLoader() looking at" << fileName; |