Question: Consider the following code. Show how it might be compiled into generic assembly language assuming that the compiler unrolls the loop three times. All values

Consider the following code. Show how it might be compiled into generic assembly language assuming that the compiler unrolls the loop three times. All values are integers. Assume that register indirect with offset addressing is available but pointers have to be explicitly updated. 

for (int i = 0; i < 30; i++) { z [i] = 3 * (x[i] + y[i]); }

for (int i = 0; i < 30; i++) { (x[i] + y [i]); z [i] = 3 * }

Step by Step Solution

3.33 Rating (159 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Assume that r0 r1 and r2 have been set up to point to x y a... View full answer

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 Computer Architecture Questions!