Question: Question 1 The following code computes Y [ i ] = a * * x [ i ] + Y [ i ] for an

Question 1
The following code computes Y[i]=a**x[i]+Y[i] for an array of length 100 doubles. Initially, R1= address of x,R2= address of Y, and F0 contains a.
ADDIU R3, R1,800
; R3= address of x+100 doubles
loop:
L.D F2,0(R1)
MUL.D F4, F2, F0
L.D F6, O(R2)
ADD.D F6, F4, F6
S.D F6, O(R2)
ADDIU R1, R1,8
ADDIU R2, R2,8
BNE R1, R3, loop
; load F2= X[i]
; F4=a**x[i]
; load F6= Y[i]
; F6=a**x[i]+Y[i]
; store F6
; increment x pointer
; increment Y pointer
; loop if (R1!= R3)
Assume the following functional unit latencies (given as stall cycles before use). The loop branch is predicted to be always taken with zero delay.
\table[[Instruction producing result,Instruction using result,Stall cycles before use],[FP operation,Another FP operation,3 stall cycles],[FP operation,FP store,2 stall cycles],[FP load,FP operation,2 stall cycles],[Integer ALU operation,Another ALU operation,0 stall cycles]]
a) Assume a single-issue 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?
 Question 1 The following code computes Y[i]=a**x[i]+Y[i] for an array of

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 Databases Questions!