3 ms·
Static branch prediction isn't found on any major architectures, right? You can optimize the code generation around that knowledge but not passing it directly
by mhh__ 7y ago
Static branch prediction isn't found on any major architectures, right?
You can optimize the code generation around that knowledge but not passing it directly to the CPU
- chrisseaton 7y ago> Static branch prediction isn't found on any major architectures, right? All major AMD and Intel processors do static branch prediction.
- hrydgard 7y agoIt is absolutely done, it's just implicit rather than explicit. The simplest heuristic is to predict backwards branches as taken (loops) and forward branches as not taken, and it works quite well (though I think it might be more sophisticated than that).
- ncmncm 7y agoOf course the error-code checking branches will most usually be forward branches, thus not predicted correctly the first time through, or after spilling.