diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2013-12-08 20:28:21 -0800 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-16 02:59:56 +0100 |
commit | 3c375a76a13e151496ccfea0a2b3ff9fdc75784f (patch) | |
tree | 18a3b920917f7697365bf3ad8e13af1c2042a8fe /mkspecs/features | |
parent | 01c59ac857927043e49d4725062faea715ed49a3 (diff) |
Automatically turn on SSE2 code generation throughout Qt
...unless the user passed the -no-sse2 option to the compiler.
[ChangeLog][Important Behavior Changes] Qt now automatically generates
code for processors supporting SSE2 on i386 platforms. To disable
this, pass the -no-sse2 option during Qt configuration. Since this
feature has been present on CPUs for 10 years and since Qt no longer
checks for runtime support for SSE2, we strongly encourage users to
leave the default setting on for best performance.
- For Linux distributions that must retain support for CPUs without
SSE2, we recommend doing two builds of Qt and installing the
SSE2-enabled libraries in the LIBDIR/sse2 directory. Tools,
plugins, and examples are not affected.
- See discussion on the Qt development mailing list:
http://lists.qt-project.org/pipermail/development/2013-November/014085.html
Change-Id: I7f9b1f58a9f66b6e5fe295bac15f87d34343695e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'mkspecs/features')
-rw-r--r-- | mkspecs/features/qt_module.prf | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index 11509eeb40..ff40e16e79 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -126,6 +126,23 @@ aix-g++* { QMAKE_CXXFLAGS += -mminimal-toc } +sse2:!contains(QT_CPU_FEATURES.$$QT_ARCH, sse2):!host_build:!if(static:contains(QT_CONFIG, shared)) { + # If the compiler supports SSE2, enable it unconditionally in all of Qt shared libraries + # (and only the libraries). This is not expected to be a problem because: + # - on Windows, sharing of libraries is uncommon + # - on Mac OS X, all x86 CPUs already have SSE2 support (we won't even reach here) + # - on Linux, the dynamic loader can find the libraries on LIBDIR/sse2/ + # The last guarantee does not apply to executables and plugins, so we can't enable for them. + QT_CPU_FEATURES.$$QT_ARCH += sse sse2 + QMAKE_CFLAGS += $$QMAKE_CFLAGS_SSE2 + QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE2 +} +gcc:equals(QT_ARCH, i386):contains(QT_CPU_FEATURES.$$QT_ARCH, sse2) { + # Turn on SSE-based floating-point math + QMAKE_CFLAGS += -mfpmath=sse + QMAKE_CXXFLAGS += -mfpmath=sse +} + android: CONFIG += qt_android_deps #install directives |