3 ms·
Rocket has a branch predictor; if you're not going to do any kind of speculation, why have it in the first place?
by jabl 9y ago
Rocket has a branch predictor; if you're not going to do any kind of speculation, why have it in the first place?
- NinjaKitten 9y agoAFAIK its load store unit does plenty speculation.
- tscs37 9y agoPreloading instructions into the cache or only executing instructions speculatively which only modify the CPU's internal state and no caches.
- al2o3cr 9y agoThe direction of a branch isn't going to be known until a couple stages into the pipeline ("EX" in the classic RISC version). Ideally, the preceding stages in the pipeline will be fed correctly - that can either be the instructions immediately following the branch (as in the "branch delay slot(s)" found in some architectures) or the instructions at where the CPU thinks the branch will lead.
- fulafel 9y agoa pipeline flush and unprefetched instruction fetch on each branch (20-25% of insns) would dramatically slow down the CPU. With branch prediction you can potentially have correctly predicted branches take zero cycles, even without speculative execution.
- blattimwind 9y agoUsing a branch predictor to start execution of a branch is speculative execution.
- fulafel 9y agoIn established computer architecture terminology, speculative execution is reserved for speculating past branches. (Speculation meaning something that may not pan out...)
- rayiner 9y agoThis shouldn’t be downvoted. The reason to have a branch predictor is so you can speculatively execute down the predicted path when you hit a branch. Although I think the Spectre attack requires not only speculation, but the ability to perform loads out of program order.
- fulafel 9y agoIt's a reason, but not the only reason. In-order superscalar processors rely heavily on branch prediction too.