@rygorous@mastodon.gamedev.place
Post #2409967
2025-09-09 05:44 UTC
@JamesWidman@mastodon.social The basic idea that landed in Tremont is quite simple:
Have two decoders that can each do 3 instructions/cycle. Switch which decode cluster you route instruction bytes to on every predicted branch.
So any given basic block can only decode 3 insns/cycle max, but you're working on decoding multiple basic blocks at once.
This works great on most code (avg length of a BB in most traces is something like 6 instructions). If you have a long basic block though, easy to get decode bound.
Replies (1)
-
@rygorous@mastodon.gamedev.place 2025-09-09 05:46
@JamesWidman@mastodon.social The variant they landed in Gracemont: on first execution, count how long the basic blocks get. When above a threshold, flag it, and the frontend conceptually inserts a dummy unconditional branch to the next instruction. So the next time through, the frontend gets a fake branch to cycle decoders every few cycles. Basically the Tremont design plus an extra wrinkle in the branch target buffers. (But still a pretty localized change.)