From: Thiago Macieira Date: Thu, 29 Dec 2011 21:28:23 +0000 (-0200) Subject: Ensure that qdrawhelper.cpp is compiled with vectorisation active X-Git-Tag: 071012110112~1959 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d6d997a36fc76132021ea45646a0069a756a62ac;p=profile%2Fivi%2Fqtbase.git 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 --- diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 774678c..43c4781 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