Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. Consider the following code: for (i 100; 1 > 0; 1-1-1) x[i] -x[i] (s is scalar) + s; a The corresponding MIPS code is:

image text in transcribed

2. Consider the following code: for (i 100; 1 > 0; 1-1-1) x[i] -x[i] (s is scalar) + s; a The corresponding MIPS code is: FO, 0 (R1) F4, FO, F2 0 (R1),F4 R1, R1, -8 R1, Loop ;FO vector element ;add scalar from F2 istore result : decrement pointer 8B (Dw) ;branch R1 != zero Loop: LW ADD Sw DADDI BNEZ Assume the following stalls in cycles between different operations: Stalls between in cvcles Instruction Instruction producing result FP ALU op FP ALU op Load double using result Another FP ALU op2 Store double FP ALUp 2 a. How many clock cycles are needed to execute this program? How many clock cycles are needed to execute the program by re-arranging the instructions in the loop? b. How many clock cycles are needed to execute the program by rearranging and unrolling the loop only 5 times? c. 2. Consider the following code: for (i 100; 1 > 0; 1-1-1) x[i] -x[i] (s is scalar) + s; a The corresponding MIPS code is: FO, 0 (R1) F4, FO, F2 0 (R1),F4 R1, R1, -8 R1, Loop ;FO vector element ;add scalar from F2 istore result : decrement pointer 8B (Dw) ;branch R1 != zero Loop: LW ADD Sw DADDI BNEZ Assume the following stalls in cycles between different operations: Stalls between in cvcles Instruction Instruction producing result FP ALU op FP ALU op Load double using result Another FP ALU op2 Store double FP ALUp 2 a. How many clock cycles are needed to execute this program? How many clock cycles are needed to execute the program by re-arranging the instructions in the loop? b. How many clock cycles are needed to execute the program by rearranging and unrolling the loop only 5 times? c

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

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899