Home  |  News  |  Reviews  | About Search :  HardWare.fr 

MiscellaneousStorageGraphics CardsMotherboardsProcessors
Advertise on BeHardware.com
Review index:
The impact of compilers on x86/x64 CPU architectures
by Guillaume Louel
Published on September 27, 2012

Generic, targeted, with dispatcher
Although we’ve spoken about how different processor models are catered for by the various different optimisations offered by compilers, we have dodged the most important question which is how to write a program which runs as well as possible on all existing processors.

Unfortunately, compilers don’t really supply a solution and developers have several choices:
Prioritise compatibility
This is the simplest option and often the one chosen by developers: create a single executable file all of the code of which runs on all modern x86 processors (generally speaking as of Pentium Pros). The compiler won’t then generate any code using SSE or AVX instruction sets. This is the default mode for compilers.
Multiple builds
As specific versions of compilers can be successfully created for given processor models, developers can simply create several versions (or builds) each of which is optimised for different types of processor.

Thus you can find standard versions for certain projects (very often open source) and SSE2 and other versions (these SSE2 builds using SSE2 arithmetic operations in place of x87).
Manual dispatcher
Developers who use assembly code can choose to make multiple builds but they can also choose to go down the dispatcher route. The concept is relatively simple and involves adding verification of the processor capabilities on which the program is running on start-up of the program. Developers can run quite a long way with this and provide sections of assembly code for numerous processor models (SSE, SSE2, AVX accelerations and so on) including those which aren’t x86 models (NEON code, SIMD instructions with ARM processors). This requires quite a bit of work from developers. x264 has such a dispatcher.
Automatic dispatcher
The last option consists in asking the compiler to generate a version of the programm that includes a dispatcher. In addition to a basic version that works anywhere, optimisations can be added by the compiler to target a given processor. You can then obtain wide compatibility as well as improved performance on a given processor. In theory this seems a perfect solution…

<< Previous page
SSE, AVX: the problematic of vectorisation

Page index
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16
Next page >>
Compilers: Microsoft, Intel, GCC  

Copyright © 1997- Hardware.fr SARL. All rights reserved.
Read our privacy guidelines.