www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - G++ 4.8 function multi versioning

An interesting feature of G++ 4.8:

http://gcc.gnu.org/wiki/FunctionMultiVersioning

It allows to write various versions of a function, for different 
CPUs.

To work it uses new built-in functions like 
__builtin_cpu_supports and __builtin_cpu_is, run-time dispatch, 
the attribute syntax, plus the syntax to specify target 
optimizations for each function:

http://gcc.gnu.org/wiki/FunctionSpecificOpt

Bye,
bearophile
Mar 11 2013