From 689e8055f5c4f3bbdbb9a90ac0405b5295f81374 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 6 Aug 2013 19:32:37 -0700 Subject: Add support for single-file multi-target intrinsics in Qt GCC 4.9 now allows us to #include any and all intrinsics headers, not just the one for which we're compiling code, a behavior that ICC and MSVC have had for some time. With that, we're able to have the functions for different targets in the same source file. See the GCC manual: http://gcc.gnu.org/onlinedocs/gcc/Function-Multiversioning.html This functionality is notified by the QT_COMPILER_SUPPORTS_HERE(XXX) macro, which indicates that all the intrinsics from QT_COMPILER_SUPPORTS_xxx are available and enabled. To complement, a QT_COMPILER_SUPPORTS(XXX) macro is also added. Unlike ICC and MSVC, GCC requires a special function attribute, which will also cause code optimization. That's the QT_FUNCTION_TARGET macro. Note: because of the absence of the target attribute, ICC and MSVC will not generate instructions with the VEX prefix unless they only exist with the VEX prefix or if -mavx / -arch:AVX are enabled. Change-Id: I0c1880c20324bd8e0fc68a863e36d1fa7755dff0 Reviewed-by: Allan Sandfeld Jensen --- tools/configure/configureapp.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tools') diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 37bf576d37..06083f2592 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -3476,21 +3476,21 @@ void Configure::generateConfigfiles() tmpStream << endl << "// Compiler sub-arch support" << endl; if (dictionary[ "SSE2" ] == "yes") - tmpStream << "#define QT_COMPILER_SUPPORTS_SSE2" << endl; + tmpStream << "#define QT_COMPILER_SUPPORTS_SSE2 1" << endl; if (dictionary[ "SSE3" ] == "yes") - tmpStream << "#define QT_COMPILER_SUPPORTS_SSE3" << endl; + tmpStream << "#define QT_COMPILER_SUPPORTS_SSE3 1" << endl; if (dictionary[ "SSSE3" ] == "yes") - tmpStream << "#define QT_COMPILER_SUPPORTS_SSSE3" << endl; + tmpStream << "#define QT_COMPILER_SUPPORTS_SSSE3 1" << endl; if (dictionary[ "SSE4_1" ] == "yes") - tmpStream << "#define QT_COMPILER_SUPPORTS_SSE4_1" << endl; + tmpStream << "#define QT_COMPILER_SUPPORTS_SSE4_1 1" << endl; if (dictionary[ "SSE4_2" ] == "yes") - tmpStream << "#define QT_COMPILER_SUPPORTS_SSE4_2" << endl; + tmpStream << "#define QT_COMPILER_SUPPORTS_SSE4_2 1" << endl; if (dictionary[ "AVX" ] == "yes") - tmpStream << "#define QT_COMPILER_SUPPORTS_AVX" << endl; + tmpStream << "#define QT_COMPILER_SUPPORTS_AVX 1" << endl; if (dictionary[ "AVX2" ] == "yes") - tmpStream << "#define QT_COMPILER_SUPPORTS_AVX2" << endl; + tmpStream << "#define QT_COMPILER_SUPPORTS_AVX2 1" << endl; if (dictionary[ "IWMMXT" ] == "yes") - tmpStream << "#define QT_COMPILER_SUPPORTS_IWMMXT" << endl; + tmpStream << "#define QT_COMPILER_SUPPORTS_IWMMXT 1" << endl; if (dictionary["QREAL"] != "double") tmpStream << "#define QT_COORD_TYPE " << dictionary["QREAL"] << endl; -- cgit v1.2.3