This is the mail archive of the
`gcc@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] |

*From*: Jonathan Wakely <jwakely dot gcc at gmail dot com>*To*: Rasmus Villemoes <rv at rasmusvillemoes dot dk>*Cc*: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, Martin Liška <mliska at suse dot cz>*Date*: Tue, 30 Oct 2018 09:58:31 +0000*Subject*: Re: [wwwdocs] Typo in description of __builtin_expect_with_probability*References*: <CAEE11jgsa13N8LUoxTVu1d_3Eeb9f34j80kApPPgKRd__1Jhfw@mail.gmail.com> <1be91cac-659b-23cf-bd3e-223d6ae38fa8@suse.cz> <ff7a6ac8-4134-7762-02b3-ef2ee2193026@rasmusvillemoes.dk> <CAH6eHdQaNg4hJrSCryPUWp3bZFnUk+HozE6oowBYdtbf49fjxQ@mail.gmail.com>

On Tue, 30 Oct 2018 at 09:54, Jonathan Wakely <jwakely.gcc@gmail.com> wrote: > > 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. 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)

**Follow-Ups**:**Re: [wwwdocs] Typo in description of __builtin_expect_with_probability***From:*Martin Liška

**References**:**[wwwdocs] Typo in description of __builtin_expect_with_probability***From:*Alexander Oblovatniy

**Re: [wwwdocs] Typo in description of __builtin_expect_with_probability***From:*Martin Liška

**Re: [wwwdocs] Typo in description of __builtin_expect_with_probability***From:*Rasmus Villemoes

**Re: [wwwdocs] Typo in description of __builtin_expect_with_probability***From:*Jonathan Wakely

Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|

Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |