Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assume that the following code segment is run on a MIPS processor with hazard detection and forwarding, in order, 5 stages pipeline (F (instruction fetch),

image text in transcribed
Assume that the following code segment is run on a MIPS processor with hazard detection and forwarding, in order, 5 stages pipeline (F (instruction fetch), D (instruction decode), E (execute), M (memory access, W (write-back)), static not taken branch prediction (branches are always predicted as not taken), etc., Below is the code segment that is running on the processor. \# code segment bge $R1,$R0,L2 L1: sw $R2,100($R1)#$R2M[$R1+100] shl $R2,$R2,1 beq $R0,$R0, L3 L2: $R2,100($R1)#M[$R1+100]$R2 addi $R2,$R2,100 addi $R3,$R3,1 beq $R0,$R0,STR END a) How many cycles does this program take? Assume all data and instructions are already in the cache, and that all register values are initially 0 . The branches are always going to be evaluated as not taken and they require two stall clock cycles each. Notice that END is a directive, not an instruction. Note: You only need to find the dependencies and establish if any of them require stall cycles. b) An optimizing compiler is used to re-order the code for faster execution. Given that the branches are always going to be "not taken", how would the new code look like? How many cycles would the code take

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

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions

Question

=+ Who has this information?

Answered: 1 week ago

Question

What is Aufbau's rule explain with example?

Answered: 1 week ago

Question

3. Job rotation is used for all levels and types of employees.

Answered: 1 week ago