3 ms·
Without actually looking at the docs, I would guess these map directly to cpu intrisics that can be used to guide the cpu branch prediction algorithms.
by zarkov99 7y ago
Without actually looking at the docs, I would guess these map directly to cpu intrisics that can be used to guide the cpu branch prediction algorithms.
- harry8 7y agoWhich cpu instructions guide branch prediction algorithms? Which cpus?
- gpderetta 7y agoAt some point pentium4 had static branch prediction hints, but they are obsolete and no longer relevant. Today __buitin_expect are mostly used to mark hot/cold branches. The compiler will normally optimize hot code for speed and cold code for size also will attempt to put cold code in separate cachelines and even pages. And other similar code layout optimizations.