Index: changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.8/changes.html,v
retrieving revision 1.10
diff -u -r1.10 changes.html
--- changes.html 10 Aug 2012 16:25:46 -0000 1.10
+++ changes.html 21 Aug 2012 02:38:40 -0000
@@ -92,6 +92,38 @@
wrong results. You must build all
modules with -mpreferred-stack-boundary=3
, including any
libraries. This includes the system libraries and startup modules.
+
__builtin_cpu_is
has been added to
+ detect if the run-time CPU is of a particular type. It returns a
+ positive integer on a match and zero otherwise. It accepts one string
+ literal argument, the CPU name. For example,
+ __builtin_cpu_is("westmere")
returns a positive integer if
+ the run-time CPU is an Intel Core i7 Westmere processor. Please refer
+ to the documentation for the list of valid CPU names recognized.__builtin_cpu_supports
has been
+ added to detect if the run-time CPU supports a particular ISA feature.
+ It returns a positive integer on a match and zero otherwise. It accepts
+ one string literal argument, the ISA feature. For example,
+ __builtin_cpu_supports("ssse3")
returns a positive integer
+ if the run-time CPU supports SSSE3 instructions. Please refer to the
+ documentation for the list of valid ISA names recognized.Caveat: If these built-in functions are called before any static
+ constructors are invoked, like during IFUNC initialization, then the CPU
+ detection initialization must be explicity run using this newly provided
+ built-in function, __builtin_cpu_init
. The initialization
+ needs to be done only once. For example, this is how the invocation would
+ look like inside an IFUNC initializer:
+ static void (*some_ifunc_resolver(void))(void) + { + __builtin_cpu_init(); + if (__builtin_cpu_is("amdfam10h") ... + if (__builtin_cpu_supports("popcnt") ... + } ++