14 Software Examples
14 – 10
.MODULE
matmul;
{
Single-Precision Matrix Multiplication
S
Z(i,j) =
∑
[X(i,k)
×
Y(k,j)] i=0 to R; j=0 to T
k=0
X is an RxS matrix
Y is an SxT matrix
Z is an RxT matrix
Calling Parameters
I1 —> Z buffer in data memory
L1 = 0
I2 —> X, stored by rows in data memory
L2 = 0
I6 —> Y, stored by rows in program memory
L6 = 0
M0 = 1
M1 = S
M4 = 1
M5 = T
L0,L4,L5 = 0
SE = Appropriate scale value
CNTR = R
Return Values
Z Buffer filled by rows
Altered Registers
I0,I1,I2,I4,I5,MR,MX0,MY0,SR
Computation Time
((S + 8)
×
T + 4)
×
R + 2 + 2 cycles