Question: 2. Consider the given code below and clock cycles given. 7 Marks 1. Identify ALL RAW dependencies. 2. Identify all the stalls that are produced

 2. Consider the given code below and clock cycles given. 7

2. Consider the given code below and clock cycles given. 7 Marks 1. Identify ALL RAW dependencies. 2. Identify all the stalls that are produced when one single code iteration is being executed. Show the overall number of cycles per iteration. 3. Schedule the loop instructions in order to reduce the number of stalls. (Hint: Loop scheduling Reordering instructions can reduce the number of stalls) 4. Unroll the loop in the following way: each unrolled iteration processes four array positions. Unrolled loop Unrolling the loop with a factor of four obtains loop : lw $ fo , ( $t0 ) lw $ f2 , ( $t1 ) add.d $ f4 , $ fo, $f 2 mul.d $ f4 , $ f4 , $f6 sw $ f4 , ( $t2) addi $t0,$t0,8 addi $t1,$t1,8 subi $t3 , $t3, 1 bnez $t3 , loop Lw and store takes 2 clock cycles add.d takes 4 clock cycles mul.d takes 6 clock cycles addi and subi takes O clock cycles bnez takes 1 clock cycles ****END*** 2. Consider the given code below and clock cycles given. 7 Marks 1. Identify ALL RAW dependencies. 2. Identify all the stalls that are produced when one single code iteration is being executed. Show the overall number of cycles per iteration. 3. Schedule the loop instructions in order to reduce the number of stalls. (Hint: Loop scheduling Reordering instructions can reduce the number of stalls) 4. Unroll the loop in the following way: each unrolled iteration processes four array positions. Unrolled loop Unrolling the loop with a factor of four obtains loop : lw $ fo , ( $t0 ) lw $ f2 , ( $t1 ) add.d $ f4 , $ fo, $f 2 mul.d $ f4 , $ f4 , $f6 sw $ f4 , ( $t2) addi $t0,$t0,8 addi $t1,$t1,8 subi $t3 , $t3, 1 bnez $t3 , loop Lw and store takes 2 clock cycles add.d takes 4 clock cycles mul.d takes 6 clock cycles addi and subi takes O clock cycles bnez takes 1 clock cycles ****END***

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!