Resolve in MEM Branches resolve in MEM with
Resolve in MEM
Branches resolve in MEM, with forwarding enabled and no delay slots. Assume stall on branch (no branch predictor) lw $t 1, 8($t 2) 1 2 3 4 5 F D E M W F F F D add $t 4, $t 5, $t 6 beq $t 1, $t 4, tgt add $t 1, $t 3, $t 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Comments Cycle 5, forward $t 1 and $t 4 add $t 5, $t 1, $t 4 add $t 3, $t 2, $t 4 tgt: lw $t 1, 8($t 2) Branch Taken case E M W Fetch target in cycle 6 because branch is now resolved
Branches resolve in MEM with forwarding enabled and no delay slots (next instruction can be fetched right after branch). Assume always not-taken predictor. lw $t 1, 8($t 2) 1 2 3 4 5 F D E M W F D E M F D add $t 4, $t 5, $t 6 beq $t 1, $t 4, tgt add $t 1, $t 3, $t 2 add $t 5, $t 1, $t 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Comments Cycle 5, forward $t 1 and $t 4 W Branch predicted as not-taken F add $t 3, $t 2, $t 4 tgt: lw $t 1, 8($t 2) Branch Taken case F D E M W Fetch target in cycle 6 because branch is now resolved
Branches resolve in MEM, with forwarding enabled and no delay slots. Assume stall on branch (no branch predictor) lw $t 1, 8($t 2) add $t 4, $t 5, $t 6 1 2 3 4 5 F D E M W F F F D E M W F D E M beq $t 1, $t 4, tgt add $t 1, $t 3, $t 2 add $t 5, $t 1, $t 4 add $t 3, $t 2, $t 4 tgt: lw $t 1, 8($t 2) Branch Not Taken case 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Comments Cycle 5, forward $t 1 and $t 4 Branch resolves in cycle 6 W
Branches resolve in MEM, with forwarding enabled and no delay slots (next instruction can be fetched right after branch). Assume always taken predictor. lw $t 1, 8($t 2) add $t 4, $t 5, $t 6 1 2 3 4 5 F D E M W F D E M W F D E M beq $t 1, $t 4, tgt add $t 1, $t 3, $t 2 add $t 5, $t 1, $t 4 add $t 3, $t 2, $t 4 tgt: lw $t 1, 8($t 2) Branch Not Taken case F D 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Comments Cycle 5, forward $t 1 and $t 4 Branch resolved in cycle 6. Misprediction! W
- Slides: 5