From d6d997a36fc76132021ea45646a0069a756a62ac Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 29 Dec 2011 19:28:23 -0200 Subject: Ensure that qdrawhelper.cpp is compiled with vectorisation active MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/gui/painting/qdrawhelper.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/gui/painting') 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 #include #include -- cgit v1.2.3