[Development] Enabling SSE2 by default on x86 builds (32-bit)
Thiago Macieira
thiago.macieira at intel.com
Thu Dec 12 19:50:49 CET 2013
On quinta-feira, 12 de dezembro de 2013 19:06:20, Pau Garcia i Quiles wrote:
> On Wed, Dec 11, 2013 at 10:21 AM, Simon Hausmann
>
> <simon.hausmann at digia.com>wrote:
> > > The other option for 5.2 would be to do runtime detection of SSE2 and
> > > enable/disable the JIT according to that.
> >
> > I think the main issue with run-time detection is that we need -msse2
> > -mfpmath=sse in order to get reliable math results (no 80-bit temps) that
> > match with our test expectations, when using the interpreter or non-inline
> > math functions.
>
> I have not looked into the actual code, I know everybody hates dlopen and I
> haven't even though about the performance implications but, what about this?
>
> - Move "maybe-SSE2" code to a separate library
We can't move most of QString and almost everything of QtQml into separate
libraries.
> - Compile that library twice, one with SSE2 (-msse2 -mfmath=sse), the other
> without SSE2
> - Ship both versions of the library: libwhatever_sse2.so,
> libwhatever_i486.so
> - On runtime, check for SSE2 and load the appropriate version
The cost of runtime checking in QString offsets the benefit. SSE2 there must be
unconditional.
Unless we can convice the dynamic linker to do the job for us. There are two
options:
- IFUNC attribute for ELF objects: I don't want it because it increases the
size of loaded code and it creates a Linux-specific path that might hide errors
elsewhere.
- loading entirely different libraries, like you suggested. The linker does
that. That's what this proposal is asking for.
> The same approach could be used in other parts of Qt, or even for having
> SSE2, SSE2, etc versions of that library/plugin
Agreed. So let's just stick to the proposal I made.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20131212/a963be38/attachment.sig>
More information about the Development
mailing list