This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH,RFC] Support non-constants as the second argument of __builtin_expect


On Wed, 15 Jul 2009, Trevor_Smigiel@playstation.sony.com wrote:

> In our Language Extensions document for Cell we extend
> __builtin_expect() to allow a non-constant in the second argument. This
> will result in a conditional prefetch instruction.

I can't tell from your message what the language-level semantics of this 
are supposed to be.  The patch fails to change extend.texi, but your 
example

>    int i = iterations
>    do
>      {
>        i--;
>      }
>    while (__builtin_expect (i > 0, i > 0));

seems useless with the presently documented semantics; it's saying that 
it's expected that (i > 0) == (i > 0), which the compiler knows is always 
true anyway.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]