[wwwdocs] Typo in description of __builtin_expect_with_probability
Jonathan Wakely
jwakely.gcc@gmail.com
Tue Oct 30 09:55:00 GMT 2018
On Tue, 30 Oct 2018 at 09:18, Rasmus Villemoes <rv@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.
>
> contradicting the prose "Last argument probability is of float type".
> So, should probability be an integer in [0, 100], or a float in [0, 1]?
>
> Rasmus
More information about the Gcc
mailing list