Effect of Branch on Pipelining (cont)
Zero test is easy from hardware point of view, put this check in the decode stage.
- Now only have one bubble in pipeline add r1, r2, r3 Executebeq r1, someplace Decode (detect branch) instr A Fetch
- ‘r1’ value forwarded from Execute stage to Decode
- Branch Target Address (BTA) always computed from fetched instruction just in case instruction is a branch
- Assumes branch offset in same place in every instruction