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 floatingpoint 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 fx
fld fx
fadd fff
fsub fff
fmul f f f
fsd fx
subi x x
subi xx
bnz x loop
We are given the following latencies for the different types of instructions.
Floating Point AddSub
Floating point Multiply
LoadStore
Integer arithmetic
Branch if not taken
Branch if taken
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
