Question: Question 1 The following code computes Y [ i ] = a * * x [ i ] + Y [ i ] for an
Question
The following code computes for an array of length doubles. Initially, address of address of and contains a
ADDIU R R
; address of doubles
loop:
LD FR
MUL.D F F F
LD F OR
ADD.D F F F
SD F OR
ADDIU R R
ADDIU R R
BNE R R loop
; load F Xi
;
; load F Yi
; F
; store F
; increment pointer
; increment pointer
; loop if R R
Assume the following functional unit latencies given as stall cycles before use The loop branch is predicted to be always taken with zero delay.
tableInstruction producing result,Instruction using result,Stall cycles before useFP operation,Another FP operation, stall cyclesFP operation,FP store, stall cyclesFP load,FP operation, stall cyclesInteger ALU operation,Another ALU operation, stall cycles
a Assume a singleissue pipeline. Show the loop code including the stall cycles. What is the number of cycles per iteration to compute one element of the array Y
b Unroll the loop Two times and schedule it to reduce stall cycles, collapsing the loop overhead instructions. Show the instruction schedule. What is the average number of cycles to compute one element of the array Y
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
