Download presentation
Presentation is loading. Please wait.
1
ammar: Branch & Pipelines
2
Branch & Pipelines Bnch ifetch read compute write ifetch read compute
Delay Slot Branch Target ifetch read compute write By the end of the read stage of the Branch instruction, the CPU knows whether or not the branch will take place. However, it will have fetched the next instruction by then, regardless of whether or not a branch will be taken.
3
Delayed Branches: Redefine behavior
Inst Fetch Dcd & Op Fetch Execute execute successor even if branch taken! Inst Fetch Dcd & Op Fetch Execute Inst Fetch Then branch target or continue Single delay slot impacts the critical path add r3, r1, r2 sub r4, r4, 1 bz r4, LL ... LL: add rd, ... Compiler can fill a single delay slot with a useful instruction 50% of the time. try to move down from above jump move up from target, if safe
4
Standard and Delayed Interpretation
5
Delayed Branches (cont.)
Execution History instr0 BCND X instr1 instr2 . X: PC nPC PC nPC PC nPC PC nPC Branch Not Taken Branch Taken t2' t2 t1 t0 Branches are the bane of pipelined machines Delayed branches complicate the compiler slightly, but make pipelining easier to implement and more effective Good strategy to move some complexity to compile time
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.