Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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?
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Temple Of Django Database Performance

Authors: Andrew Brookins

1st Edition

1734303700, 978-1734303704

More Books

Students also viewed these Databases questions

Question

Show the properties and structure of allotropes of carbon.

Answered: 1 week ago

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago