aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/development/gcc.md4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/development/gcc.md b/src/development/gcc.md
index 88e44fc..39ae753 100644
--- a/src/development/gcc.md
+++ b/src/development/gcc.md
@@ -29,6 +29,10 @@ Give the compiler a hint which branch is hot, so it can lay out the code
accordingly to reduce number of jump instructions.
See on [compiler explorer](https://godbolt.org/z/MbTHAP).
+The semantics of this hint are as follows, the compiler prioritises `expr ==
+cond`. So `__builtin_expect(expr, 0)` means that we expect the `expr` to be `0`
+most of the time.
+
```bash
echo "
extern void foo();