Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Textbook 6.4 Consider the following piece of C code: for (J-2;j 1000 ; j++) D[j]

ID: 3705654 • Letter: T

Question

Textbook 6.4 Consider the following piece of C code: for (J-2;j 1000 ; j++) D[j]D[j-1]+D[j-2]; The MIPS code corresponding to the above fragment is: addiu $s2,$zero,7992 addiu $s1,$zero,16 loop: 1.d $f0, -16($s1) 1.d $f2, -8($s1) add.d $f4, $fe, $f2 s.d $f4, 0($s1) addiu $s1, $s1, 8 bne $s1, $s2, loop Instructions have the following associated latencies (in cycles) addiu Text version (part a) Sri version (part b) Add.d 4 6 6 4 6 6.4.2 [10] When an instruction in a later iteration of a loop depends upon a data value produced in an earlier iteration of the same loop, we say that there is a loop carried dependence between iterations of the loop. Identify the loop-carried dependences in the above code. Identify the dependent program variable and assembly-level registers. You can ignore the loop induction variable j

Explanation / Answer

As per the definition given for Loop carried Dependence , array elements D[j] and D[j-1] have loop carried dependency.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote