I'm preparing for a university exam, the course talks about Calculator, specifically the MIPS 64, I'll get to the point, an exercise ask me the use the loop unrolling using multidimensional arrays, however, I'm able to handle the exercise as long as exercis ask me to use simple array.
So, I need your help.
Example, the matrix is squared:
for (i=0;i<n; i++)
{ for(y=0;y<n;y++)
{
g[i][y] = g[i][y] + a;
}}
So, I want use an loop unrolling factor equal to 4, so my code becomes:
for (i=0; i<n; i++)
{for (y=0; y+4-1<n; y=y+4)
{ g[i][y]= g[i][y] + a;
g[i][y+1]= g[i][y+1] + a;
g[i][y+2]= g[i][y+2] + a;
g[i][y+3]= g[i][y+3] + a;
}}
Using MIPS 64 Assembly, how can I write my code?