aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorSandra Loosemore <sandra@codesourcery.com>2018-11-11 13:39:10 -0500
committerSandra Loosemore <sandra@gcc.gnu.org>2018-11-11 13:39:10 -0500
commit6157c37500dd889e46ded9a8eb357de9a71de0eb (patch)
tree54aa4fde74a1eb33fa069880fbdef3764ff7f680 /gcc/doc
parentbd5d3961572e2d65ed0e612235f0c7a28305cf98 (diff)
downloadgcc-6157c37500dd889e46ded9a8eb357de9a71de0eb.zip
gcc-6157c37500dd889e46ded9a8eb357de9a71de0eb.tar.gz
gcc-6157c37500dd889e46ded9a8eb357de9a71de0eb.tar.bz2
re PR c/26366 (__builtin_expect needs better documentation)
2018-11-11 Sandra Loosemore <sandra@codesourcery.com> PR c/26366 gcc/ * doc/extend.texi (Other Builtins): Document probability associated with __builtin_expect. From-SVN: r266017
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/extend.texi6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 5ce5069..022d0e0 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -12121,6 +12121,12 @@ if (__builtin_expect (ptr != NULL, 1))
@noindent
when testing pointer or floating-point values.
+
+For the purposes of branch prediction optimizations, the probability that
+a @code{__builtin_expect} expression is true is controlled by GCC's
+@code{builtin-expect-probability} parameter, which defaults to 90%.
+You can also use @code{__builtin_expect_with_probability} to explicitly
+assign a probability value to individual expressions.
@end deftypefn
@deftypefn {Built-in Function} long __builtin_expect_with_probability