summaryrefslogtreecommitdiffstats
path: root/configure.pri
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-11-15 21:01:15 -0800
committerThiago Macieira <thiago.macieira@intel.com>2017-11-30 08:30:40 +0000
commita09fc184acd0874ea9876cdb2c4b123b226d8587 (patch)
treec3808834554d1de1411ef115863dc60482551c76 /configure.pri
parentff1ffa7577ba88412daf9904bbc1e4de9e024436 (diff)
Add a configure-time check for QT_COMPILER_SUPPORTS_SIMD_ALWAYS
This has two main benefits: 1) introduces a qmake CONFIG we can use in .pro/.pri/.prf files 2) removes the need to keep an up-to-date list of which compilers support the feature The test is implemented as trying to compile every single SIMD test we currently have, but without passing the -mXXX option. The reason for trying all of them is that some people may have modified their mkspecs to add -mXXX options or -march=XXX, which could enable the particular feature we tried, resulting in a false positive outcome. Change-Id: I938b024e38bf4aac9154fffd14f7784dc8d1f020 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'configure.pri')
-rw-r--r--configure.pri13
1 files changed, 13 insertions, 0 deletions
diff --git a/configure.pri b/configure.pri
index 83c0dee141..52147589bb 100644
--- a/configure.pri
+++ b/configure.pri
@@ -395,6 +395,19 @@ defineTest(qtConfTest_buildParts) {
return(true)
}
+defineTest(qtConfTest_x86SimdAlways) {
+ configs =
+ fpfx = $${currentConfig}.features
+ simd = sse2 sse3 ssse3 sse4_1 sse4_2 rdrnd aesni shani avx avx2 avx512f \
+ avx512er avx512cd avx512pf avx512dq avx512bw avx512vl avx512ifma avx512vbmi
+ for (f, simd) {
+ qtConfCheckFeature($$f)
+ equals($${fpfx}.$${f}.available, true): configs += $$f
+ }
+ $${1}.literal_args = $$system_quote(SIMD=$$join(configs, " "))
+ qtConfTest_compile($${1})
+}
+
# custom outputs
# this reloads the qmakespec as completely as reasonably possible.