Question: Problem #5 (Loop Unrolling) (a) What is loop unrolling and why it is used? What are the pros and cons of loop unrolling? (b) Unroll
Problem #5 (Loop Unrolling) (a) What is loop unrolling and why it is used? What are the pros and cons of loop unrolling? (b) Unroll the loop two times and then draw an instruction scheduling diagram for the following code executed on a 2-issue processor (where one of the instructions can be integer ALU or branch and the other can be load or store). Reorder the instructions to avoid as many pipeline stalls as possible to schedule the instructions in minimum number of clock cycles. Compute the IPC for the code too. Loop: lw $2,0($4) addi $2, $2, #10 $3, 64($4) addi $3, $3, #20 add $5, $2, $3 SW $5, 128($4) addi $4, $4, #4 bne $4, $7, Loop Problem #5 (Loop Unrolling) (a) What is loop unrolling and why it is used? What are the pros and cons of loop unrolling? (b) Unroll the loop two times and then draw an instruction scheduling diagram for the following code executed on a 2-issue processor (where one of the instructions can be integer ALU or branch and the other can be load or store). Reorder the instructions to avoid as many pipeline stalls as possible to schedule the instructions in minimum number of clock cycles. Compute the IPC for the code too. Loop: lw $2,0($4) addi $2, $2, #10 $3, 64($4) addi $3, $3, #20 add $5, $2, $3 SW $5, 128($4) addi $4, $4, #4 bne $4, $7, Loop
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
