Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
loop:
fld fx
fld fx
fadd f f f
fsub f f f
fmul f f f
fsd fx
subi x x
subi x x
bnz x loop
We are given the following latencies for the different types of instructions.
Floating point Multiply:
Floating Point AddSub:
Integer arithmetic:
LoadStore:
Branch if not taken:
Branch if taken:
Remember how to use latencies. For example, since fadd and sub have latencies of the fmul f f f which needs the results of fsub f f f must wait cycles from when fsub starts.
a Show how many cycles are needed to complete one iteration without reordering, but with data forwarding. DO NOT use delayed branch. Create a table that includes stalls not pipeline stages but stalls between instructions.
b Reorder instructions and show how many cycles are needed to complete one iteration. Show reordered code and cycles needed.
c Unroll the loop times, reorder instructions and show how many cycles are needed to complete two iterations.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started