Question: Consider the following codes. Loop: L.D fO, 0(rl) ADD.D f4, f0, 2 S.D f4, 0 (rl) ADDI r1, r1, #-8 BNE rl, r2, Loop ADDI

Consider the following codes. Loop: L.D fO, 0(rl) ADD.D f4, f0, 2 S.D f4, 0 (rl) ADDI r1, r1, #-8 BNE rl, r2, Loop ADDI r1, r1, #-16 LD f0, 16(r1) ADD.D f4, 0, f2 Loop: S.D f4, 16(rl) ADD.D f4, f0, 2 ADDI r1, r1, #-8 BNE rl, r2, Loop S.Df4, 8 (rl) ADD.D f4, 0, f2 S.D f4, 0 (rl) a) assume that rl-r2+800. Demonstrate that the two pieces of code I) and II) are functionally equivalent b) assume the standard latencies as we used from the 5-stage pipeline. Calculate how many cycles it takes to execute the codes above. Assume that branch are predicted correctly, and there is no delay in fetching the instruction in the next iteration of the code. This technique to improve the performance is called software pipelining. Consider the following codes. Loop: L.D fO, 0(rl) ADD.D f4, f0, 2 S.D f4, 0 (rl) ADDI r1, r1, #-8 BNE rl, r2, Loop ADDI r1, r1, #-16 LD f0, 16(r1) ADD.D f4, 0, f2 Loop: S.D f4, 16(rl) ADD.D f4, f0, 2 ADDI r1, r1, #-8 BNE rl, r2, Loop S.Df4, 8 (rl) ADD.D f4, 0, f2 S.D f4, 0 (rl) a) assume that rl-r2+800. Demonstrate that the two pieces of code I) and II) are functionally equivalent b) assume the standard latencies as we used from the 5-stage pipeline. Calculate how many cycles it takes to execute the codes above. Assume that branch are predicted correctly, and there is no delay in fetching the instruction in the next iteration of the code. This technique to improve the performance is called software pipelining
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
