- Jul 27, 2020
- 26,210
- 18,054
- 146
Branch predictor: How many "if"s are too many? Including x86 and M1 benchmarks! (cloudflare.com)
Anyone know if these tests have been done for the recent CPUs (M2 / Zen 4 / Raptor Lake)?
On x86 the hot code needs to split the BTB budget between function calls and taken branches. The BTB has only a size of 4096 entries. There are strong benefits in keeping the hot code under 16KiB.
On the other hand on M1 the BTB seems to be limited by L1 instruction cache. If you're writing super hot code, ideally it should fit 4KiB.
Anyone know if these tests have been done for the recent CPUs (M2 / Zen 4 / Raptor Lake)?