6 ms·
What you are describing is a Branch Target Buffer (BTB). While local and global predictors describe which direction a direct branch may take, they do little to
by cokernel_hacker 12y ago
What you are describing is a Branch Target Buffer (BTB).
While local and global predictors describe which direction a direct branch may take, they do little to help indirect branches.
Take the example jmp [rax]. While condition codes for direct branches can be speculated, the value contained within rax isn't easily speculated either.
However, we can make note of where jmp [rax] took us the last time we executed. This mapping from branch instruction address to target address is precisely what a BTB is.
As for when they were invented, I believe the first paper on them is Lee83; I'm pretty sure the original Pentium had one.
Lee83 http://www.eecs.berkeley.edu/Pubs/TechRpts/1983/CSD-83-121.pdf http://www.eecs.berkeley.edu/Pubs/TechRpts/1983/CSD-83-121.p...
- wsxcde 12y agoNo, I know quite well what a BTB is and it's only somewhat useful for indirect branches. Modern processors have specific predictors for indirect branches. This paper: http://dl.acm.org/citation.cfm?id=279380 http://dl.acm.org/citation.cfm?id=279380 describes one such structure. It also explains why such structures outperform BTBs.