Question: 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]]
 Consider the following code segment: Loop: fld f0,0(x1)//f0=array element fadd.d f4,f0,f2//add

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!