From a09fc184acd0874ea9876cdb2c4b123b226d8587 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 15 Nov 2017 21:01:15 -0800 Subject: 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 --- configure.pri | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'configure.pri') 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. -- cgit v1.2.3