Message ID | CAAs8Hmzqhd0NjDocYQJBG4oVYfSv9NFtYeGShmkovEf+8tk4Hg@mail.gmail.com |
---|---|
State | New |
Headers | show |
On 2012-08-20 22:41 , Sriraman Tallam wrote: > Hi Gerald / Diego, > > I have made all the mentioned changes. I also shortened the > description like Diego mentioned by removing all the strings but kept > the caveats. I have not added a reference to the documentation because > i do not know what link to reference. The builtins are completely > documented in extend.texi. Referring to the user's manual is OK, I think. > + <p>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 s/explicity/explicitly/ Other than that, it looks fine to me. Diego.
Committed after making the changes. One small problem, I am not sure how to fix this: The hyper link I referenced is : http://gcc.gnu.org/onlinedocs/gcc/X86-Built_002din-Functions.html#X86-Built_002din-Functions whereas the committed changes.html is pointing to: http://gcc.gnu.org/onlinedocs/gcc/X86-Built-in-Functions.html#X86-Built-in-Functions Please note that the "_002din" is missing. This makes the link broken, did I miss anything? I verified that I submitted the right link. Thanks, -Sri. On Tue, Aug 21, 2012 at 5:41 AM, Diego Novillo <dnovillo@google.com> wrote: > On 2012-08-20 22:41 , Sriraman Tallam wrote: >> >> Hi Gerald / Diego, >> >> I have made all the mentioned changes. I also shortened the >> description like Diego mentioned by removing all the strings but kept >> the caveats. I have not added a reference to the documentation because >> i do not know what link to reference. The builtins are completely >> documented in extend.texi. > > > Referring to the user's manual is OK, I think. > >> + <p>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 > > > s/explicity/explicitly/ > > Other than that, it looks fine to me. > > > Diego.
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 <code>-mpreferred-stack-boundary=3</code>, including any libraries. This includes the system libraries and startup modules.</li> + <li> New built-in functions to detect run-time CPU type and ISA: + <ul> + <li>A built-in function <code>__builtin_cpu_is</code> 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, + <code>__builtin_cpu_is("westmere")</code> 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.</li> + <li>A built-in function <code>__builtin_cpu_supports</code> 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, + <code>__builtin_cpu_supports("ssse3")</code> 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.</li> + </ul> + <p>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, <code>__builtin_cpu_init</code>. The initialization + needs to be done only once. For example, this is how the invocation would + look like inside an IFUNC initializer:</p> + <pre> + static void (*some_ifunc_resolver(void))(void) + { + __builtin_cpu_init(); + if (__builtin_cpu_is("amdfam10h") ... + if (__builtin_cpu_supports("popcnt") ... + } + </pre> + </li> </ul> <h3 id="mips">MIPS</h3>