Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Given the following MIPS code snippet (note that instruction #6 could be anything): loop: 1 addi t, to, 4 3 v, 20 (sto) 4

image text in transcribed

1. Given the following MIPS code snippet (note that instruction #6 could be anything): loop: 1 addi t, to, 4 3 v, 20 (sto) 4 lw$90,60($to) 6 bne * 7 ## The following instruction could be anything! a) Detect hazards and insert no-ops to insure correct operation. Assume no delayed branch, no forwarding units and no interlocked pipeline stages. Your answer on the right should take the form of pairs) of numbers: num@location - indicating num no-ops should be placed at location. E.g, if you wanted to place 6 noops between lines 2 and 3 fi.e., location 2.5) and 8 noops between lines 5 and 6 (i.e. location-5.5), you would write: "5@2.5, 8@5.5 b) Now, reorder/rewrite the program to maximize performance. Assume delayed branch and forwarding units, but no interlocked pipeline stages. For unknown reasons, the first instruction after the loop label must be the addi. Feel free to insert no-ops where needed. You should be able to do it using 6 instructions per loop (10 pts) or only 5 instructions (hard, 15 pts) ##Extra instruction before loop (if any) ##Extra instruction before loop (if any) loop: 1 addi sco, sto, 4 4 6 ## The following instruction could be anything! 1. Given the following MIPS code snippet (note that instruction #6 could be anything): loop: 1 addi t, to, 4 3 v, 20 (sto) 4 lw$90,60($to) 6 bne * 7 ## The following instruction could be anything! a) Detect hazards and insert no-ops to insure correct operation. Assume no delayed branch, no forwarding units and no interlocked pipeline stages. Your answer on the right should take the form of pairs) of numbers: num@location - indicating num no-ops should be placed at location. E.g, if you wanted to place 6 noops between lines 2 and 3 fi.e., location 2.5) and 8 noops between lines 5 and 6 (i.e. location-5.5), you would write: "5@2.5, 8@5.5 b) Now, reorder/rewrite the program to maximize performance. Assume delayed branch and forwarding units, but no interlocked pipeline stages. For unknown reasons, the first instruction after the loop label must be the addi. Feel free to insert no-ops where needed. You should be able to do it using 6 instructions per loop (10 pts) or only 5 instructions (hard, 15 pts) ##Extra instruction before loop (if any) ##Extra instruction before loop (if any) loop: 1 addi sco, sto, 4 4 6 ## The following instruction could be anything

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

Students also viewed these Databases questions