Question: Consider the following assembly program written for a 3 2 - bit MIPS machine with no delayed branches. li r 2 0 , 0 #

Consider the following assembly program written for a 32-bit MIPS machine with no delayed
branches.
li r20,0 # load immediate
li r19,16000
li r15,0
start:
ld r1,0(r20) # load into r1 from memory
add r15, r15, r1
addi r20, r20,32 # add immediate
sub r3, r19, r20
bnez r3, start # jump to start if r3 not equal with zero
a) Identify the RAW, WAR and WAW conflicts in the assembly program.
b) Assume that the program is run on a machine where there is a stall of 3 cycles between
the writing and the reading of a register[1]
. Rewrite the assembly program by inserting NOP
operations where there will be stalls. Unroll the loop in the program 4 times in software
(assembly). Transform the program by register renaming such that the number of stalls is
minimized.

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!