Answered step by step
Verified Expert Solution
Link Copied!

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 floating-point instructions use floating point registers labeled f. Integer instructions use integer registers labeled x. 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 Multiply: 5 Floating Point Add/Sub:3 Integer arithmetic:1 Load/Store:2 Branch if not taken: 1 Branch if taken: 2 Remember how to use latencies. For example, since fadd and sub have latencies of 3, the fmul f8, f4, f6 which needs the results of fsub f4, f0, f10 must wait 3 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 2 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

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

Computer Aided Database Design

Authors: Antonio Albano, Valeria De Antonellis, A. Di Leva

1st Edition

0444877355, 978-0444877352

More Books

Students also viewed these Databases questions