Question: You are given the following code. Note that floating - point instructions use floating point registers labeled f . Integer instructions use integer registers labeled

You are given the following code. Note that floating-point instructions use floating point registers labeled f. Integer instructions use integer registers labeled x. Remember that the first operand is the destination. The memory address referenced in fld and fsd are obtained by adding the displacement to the value in the index register.
loop: fld f0,0(x1)
fld f2,0(x2)
fadd f6,f2,f12
fsub f4,f0,f10
fmul f8, f4, f6
fsd f8,0(x2)
subi x1, x1,8
subi x2,x2,8
bnz x1, loop
We are given the following latencies for the different types of instructions.
Floating Point Add/Sub -3
Floating point Multiply -5
Load/Store -2
Integer arithmetic -1
Branch if not taken -1
Branch if taken -2
a). Show how many cycles are needed to complete one iteration without reordering. DO NOT use delayed branch.
b). Reorder instructions and show how many cycles are needed to complete one iteration. BE CAREFUL
TO ADJUST OFFSETS WITH fsd WHEN YOU REORDER INSTRUCTIONS.

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!