3 ms·
Processors over the last 10 or so years have included more and more sophisticated indirect branch predictors. (I think the trend started with Banias which debut
by wsxcde 12y ago
Processors over the last 10 or so years have included more and more sophisticated indirect branch predictors. (I think the trend started with Banias which debuted in 2003.) This was primarily motivated by the proliferation of virtual function calls in object oriented code.
ed: If I remember my numbers right, these predictors buy a few percentage of performance improvement across entire benchmark suites, which is quite hard to get through a purely microarchitectural feature.
- cokernel_hacker 12y agoWhat 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.