summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2011-12-29 19:28:23 -0200
committerQt by Nokia <qt-info@nokia.com>2012-03-28 21:24:43 +0200
commitd6d997a36fc76132021ea45646a0069a756a62ac (patch)
tree3ca001f2a73dbaae2632e79ad44b3b688e4d154a /src
parentaf3c7d35b6937d6b5ba94243f76b540e18a04567 (diff)
Ensure that qdrawhelper.cpp is compiled with vectorisation active
The GCC option -ftree-vectorize is enabled only at level -O3, so force -O3 if this is an optimised build. Also, ensure that we're using SSE for floating point math if we're in x86 (32-bit) builds. No change is necessary for the Intel compiler, since it enables vectorisation by default at any non-zero -O level. These options are not possible with MSVC. Change-Id: If1169a73cd8a3e8b34d9e21f281b78897b9aec3e Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qdrawhelper.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 774678c67f..43c4781197 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -39,6 +39,15 @@
**
****************************************************************************/
+#if defined(__OPTIMIZE__) && !defined(__INTEL_COMPILER) && defined(__GNUC__) \
+ && (__GNUC__ * 100 + __GNUC_MINOR__ >= 404)
+// GCC 4.4 supports #pragma GCC optimize and #pragma GCC target
+# pragma GCC optimize "O3"
+# if defined(__i386__) && defined(__SSE2__) && !defined(__SSE2_MATH__)
+# pragma GCC target "fpmath=sse"
+# endif
+#endif
+
#include <qstylehints.h>
#include <qguiapplication.h>
#include <qatomic.h>