Answered step by step
Verified Expert Solution
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:
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
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