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.json | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'configure.json') diff --git a/configure.json b/configure.json index 07549e0b7e..9ae3cc284a 100644 --- a/configure.json +++ b/configure.json @@ -218,7 +218,7 @@ }, "testTypeAliases": { - "compile": [ "library", "architecture" ] + "compile": [ "library", "architecture", "x86SimdAlways" ] }, "tests": { @@ -563,6 +563,11 @@ "test": "avx512", "args": "AVX512=VBMI" }, + "x86SimdAlways": { + "label": "Intrinsics without -mXXX argument", + "type": "x86SimdAlways", + "test": "x86_simd" + }, "mips_dsp": { "label": "MIPS DSP instructions", "type": "subarch", @@ -1111,6 +1116,14 @@ { "type": "define", "name": "QT_COMPILER_SUPPORTS_SHA", "value": 1 } ] }, + "x86SimdAlways": { + "label": "Intrinsics without -mXXX option", + "condition": "(arch.i386 || arch.x86_64) && tests.x86SimdAlways", + "output": [ + "privateConfig", + { "type": "define", "name": "QT_COMPILER_SUPPORTS_SIMD_ALWAYS", "value": 1 } + ] + }, "mips_dsp": { "label": "DSP", "condition": "arch.mips && tests.mips_dsp", @@ -1397,6 +1410,11 @@ Configure with '-qreal float' to create a build that is binary-compatible with 5 "args": "aesni f16c rdrnd shani", "condition": "(arch.i386 || arch.x86_64)" }, + { + "type": "feature", + "args": "x86SimdAlways", + "condition": "(arch.i386 || arch.x86_64) && !config.msvc" + }, { "type": "feature", "args": "neon", -- cgit v1.2.3