Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

this is my prompt Implement a matmul function that uses the ARM ADD and MUL ( or MLA ) instruction in the file named matmul

this is my prompt Implement a matmul function that uses the ARM ADD and MUL (or MLA) instruction in the file named matmul-mul. Test to ensure that your outputs match the provided outputs for the matrices of size 16,64,256, and 1024. I have implemented my code in armv8 based on the c code provided below but my code is not working properly and i am struggling to debig using gdb. Please helP implement the code below in armv8
///////////////////////////////////////////////////////////////////////////////2// You're implementing the following function in ARMV8 Assembly
3//! C = A * B
4//! @param C result matrix 5//! @param A matrix A
6//! @param B matrix B
7//! @param hA height of matrix A
8//! @param wA width of matrix A, height of matrix B
9//! @param wB width of matrix B
10//
11// Note that while A, B, and C represent two-dimensional matrices,
12// they have all been allocated linearly. This means that the elements
13// in each row are sequential in memory, and that the first element
14// of the second row immedialely follows the last element in the first
15// row, etc.
16/
/17//void matmul(int* C, const int* A, const int* B, unsigned int hA,
18// unsigned int wA, unsigned int wB)19//{
20// for (unsigned int i =0; i < hA; ++i)//outer_loop_i
21// for (unsigned int j =0; j < wB; ++j){//inner loop_j
22// int sum =0;
23// for (unsigned int k =0; k < wA; ++k){ inner_loop k
24// sum += A[i * wA + k]* B[k * wB + j];
25//}
26// C[i * wB + j]= sum; //innermost
27// NOTE: This version should use the MUL/MLA and ADD instructions

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions

Question

107 MA ammeter 56 resistor ? V voltmeter

Answered: 1 week ago