Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following code segment: Loop: fld f 0 , 0 ( x 1 ) / / f 0 = array element fadd.d f 4

Consider the following code segment:
Loop: fld f0,0(x1)//f0=array element
fadd.d f4,f0,f2//add scalar in f2
fsd f4,0(x1)//store result
addi x1,x1,-8//decrement pointer 8 bytes (per DW)
bne x1,x2,Loop //branch x1!=x2
Unroll the loop 4 times but do not do any code scheduling, although you can drop some instructions as longas they do not change meaning of the program.How many clock cycles will this loop take in one iteraton?Consider the following code segment:
Figure 3.2 Latencies of FP operations used in this chapter. The last column is the
number of intervening clock cycles needed to avoid a stall. These numbers are similar
to the average latencies we would see on an FP unit. The latency of a floating-point load
to a store is 0 because the result of the load can be bypassed without stalling the store.
We will continue to assume an integer load latency of 1 and an integer ALU operation
latency of 0(which includes ALU operation to branch).
Unroll the loop 4 times but do not do any code scheduling, although you can drop some instructions as long
as they do not change meaning of the program.
How many clock cycles will this loop take in one iteraton?
Note: Try to minimise the cycles ???
\table[[??,vv,2,of 2]]
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

More Books

Students also viewed these Databases questions

Question

What did they do? What did they say?

Answered: 1 week ago