[Interest] Qt and SSE2

Thiago Macieira thiago.macieira at intel.com
Fri Feb 9 17:36:59 CET 2018


On Friday, 9 February 2018 08:15:19 PST Eric Lemanisser wrote:
> Qt is built with SSE2 by default since 5.3.0. Is there a reason for not
> enabling by default SSE2 for application compilation ? If not I'll start
> working on a change doing that.

Because we didn't want to force that on users. It's also easy to keep two 
libraries on Linux, one for SSE2 and one for earlier versions. That can't be 
done for binaries.

Enabling SSE2 alone won't gain you much. You must also either switch to SSE 
math (-mfp-math=sse) or enable the vectoriser (-ftree-vectorize or -O3).  The 
vectoriser increases code size, so it's not always welcome.

We force SSE math in Qt builds if SSE is enabled and we also compile both 
QtCore and QtGui with -O3, but not any of the other modules.

> Also, any plan migrating to SSE3 or SSSE3 ?

The gain is very modest from one to the other. There are a couple of functions 
optimised for SSSE3, some more for SSE4.1, and maybe one for SSE4.2. The 
biggest gain is AVX and again with AVX2.

And just like before, on Linux, you can keep AVX2 libraries parallel to SSE2 
and non-optimised ones. That's not the case for any of the other (recent) CPU 
features.

I think the Apple fat binaries also have an architecture "x86_64h" where the 
"h" stands for "Haswell" and do allow parallel binary for AVX2.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center






More information about the Interest mailing list