On Tue, 30 Oct 2018 at 09:54, Jonathan Wakely <jwakely....@gmail.com> wrote: > > On Tue, 30 Oct 2018 at 09:18, Rasmus Villemoes <r...@rasmusvillemoes.dk> > wrote: > > > > On 2018-10-30 09:29, Martin Liška wrote: > > > On 10/30/18 3:56 AM, Alexander Oblovatniy wrote: > > >> Hello, > > >> > > >> I'd like to report a typo in description of > > >> «__builtin_expect_with_probability»: > > >> https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#Other-Builtins > > >> > > >> The description starts with "The built-in has same semantics as > > >> *__builtin_expect_with_probability*", but it seems like > > >> *__builtin_expect* > > >> should be there. > > > > > > Thanks for reporting the issue. It's fixed as r265615. > > > > Other issues around the same place: "expected probability (in percent)" > > seems to contradict "valid values are in inclusive range 0.0f and 1.0f". > > The prototype is listed as > > > > (long exp, long c, long probability) > > The testcases added alongside the new built-in use float arguments, > but the actual definition of the built-in seems to use a long double. > > What does "user can provide expected probability (in percent) for > value of @var{exp}" mean? What is the probability of the value of exp? > Don't you mean the probability that exp==c? > > Also the grammar in the text needs several fixes.
Maybe something like: --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -12025,12 +12025,12 @@ when testing pointer or floating-point values. @end deftypefn @deftypefn {Built-in Function} long __builtin_expect_with_probability -(long @var{exp}, long @var{c}, long @var{probability}) +(long @var{exp}, long @var{c}, long double @var{probability}) -The built-in has same semantics as @code{__builtin_expect}, -but user can provide expected probability (in percent) for value of @var{exp}. -Last argument @var{probability} is of float type and valid values -are in inclusive range 0.0f and 1.0f. +This function has the same semantics as @code{__builtin_expect}, +but the caller provides the expected probability that @var{exp} == @var{c}. +The last argument, @var{probability}, is a floating point value in the +range 0.0 to 1.0, inclusive. @end deftypefn @deftypefn {Built-in Function} void __builtin_trap (void)