Question: Consider the following MIPS instruction sequence for the SAXPY loop (a common loop in scientific programs) given below to be run on a 5-stage pipelined
Consider the following MIPS instruction sequence for the SAXPY loop (a common loop in scientific programs) given below to be run on a 5-stage pipelined VLIW MIPS datapath with 2 instructions per bundle (the first must be an ALU or branch operation, the second must be a load or store operation).
lp: lw $t0, 0($s2) add $t1, $t0, $t0 add $t1, $t1, $t0
lw $t2, 0($s3) add $t4, $t1, $t2 sw $t4, 0($s3) addi $s2, $s2, 4 addi $s3, $s3, 4 subi $s0, $s0, 1 bne $s0, $0, lp
a. Show the schedule for the code in the minimum number of cycles without using loop unrolling. What is the CPI of your (not unrolled) scheduled code?
b. Now show the schedule for the code in the minimum number of cycles assuming the loop has been unrolled by the compiler one time (so the loop index is a multiple of two). What is the CPI of this unrolled scheduled code?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
