1,176 views
3 votes
3 votes

Can anyone explain the concept of branch folding, I didn't get it after reading from hamacher.Further it was explained using this diagram,I have a doubt here : Is it possible to have two decode operations in the same cycle (Cycle 6 D3 and D5) will it not be a structural hazard as both the instructions are using the same device?Hamacher Page 469 Diagram 

1 Answer

0 votes
0 votes

Any instructions that lie between the branch instruction and it's target are basically discarded : branch folding.


Now coming to your diagram doubt, Here it's clearly mentioned that I5 is the branch instruction and Ik is it's target, so need not to worry about any type of hazard because I6 and all other instructions between I5 and Ik are anyways discarded(As per my definition).
So the target instruction Ik will fetch the instruction only after the branch instruction I5 is over.
Hope it's clear enough!  :)

edited by

Related questions

0 votes
0 votes
0 answers
3
0 votes
0 votes
1 answer
4