Question: ( Loop unrolling and instruction reordering ) Given the code segment shown below, assume we use a conventional 5 - stage pipeline. Load - use


(Loop unrolling and instruction reordering) Given the code segment
shown below, assume we use a conventional 5-stage pipeline. Load-use would
cause 1-cycle pipeline stall, and branches are resolved at the instruction decode
stage. Registers St0 ~ St9 are for temporal use. Please answer the following
questions.
Loop: lw. $to,0($s1)
addu $t0, St0, $s2
SW $t0,0($s1)
add $s1, $s1,-4
bne $s1, Szero, Loop
(a)(4 pts) Without loop unrolling and instruction reordering, how many
needed to execute four iterations?
(b)(16 pts) With loop unrolling that unrolls the loop four times and instruction
reordering, how many cycles are required to execute fous iterations?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!