This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH,RFC] Support non-constants as the second argument of __builtin_expect
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Trevor_Smigiel at playstation dot sony dot com
- Cc: gcc-patches at gcc dot gnu dot org, andrew_pinski at playstation dot sony dot com, Ulrich Weigand <Ulrich dot Weigand at de dot ibm dot com>
- Date: Wed, 15 Jul 2009 21:51:41 +0000 (UTC)
- Subject: Re: [PATCH,RFC] Support non-constants as the second argument of __builtin_expect
- References: <20090715214135.GR12536@playstation.sony.com>
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