Question: Write a RV32IM assembly program that implements the code segment in C (integer aXpY). How long does it take to complete a program assuming
Write a RV32IM assembly program that implements the code segment in C (integer aXpY). How long does it take to complete a program assuming 5-stage RV32IM. What is execution time of single interation of the loop iaXPY? Bonus (). Write another version of this program that will operate on 64-bit integers (a, X, Y, and Z are 64- bit long). The program should also be optimized. Please note that you should still use RV32IM, rather than RV64IM. Activa Go to S #define W 20 int main() { int x[W] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19); int Y[W] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); int Z[W]; int a=2; iaXpY (a, X, Y, Z); return 0; }; void iaxpy (int a, int *x, int *Y, int *Z) { register int i=0; ww for (int i = 0; i < W; i++) { w Z[i] = a*x[i] + Y[i]; w w } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
