Matrix - Texas Instruments TMS320C64X Programmer's Reference Manual

Dsp little-endian dsp library
Hide thumbs Also See for TMS320C64X:
Table of Contents

Advertisement

4.6 Matrix

DSP_mat_mul
Function
Arguments
Description
Algorithm
Matrix Multiplication
void DSP_mat_mul(const short * restrict x, int r1, int c1, const short * restrict
y, int c2, short * restrict r, int qs)
x [r1*c1]
Pointer to input matrix of size r1*c1.
r1
Number of rows in matrix x.
c1
Number of columns in matrix x. Also number of rows in y.
y [c1*c2]
Pointer to input matrix of size c1*c2.
c2
Number of columns in matrix y.
r [r1*c2]
Pointer to output matrix of size r1*c2.
qs
Final right−shift to apply to the result.
This function computes the expression "r = x * y" for the matrices x and y. The
columnar dimension of x must match the row dimension of y. The resulting
matrix has the same number of rows as x and the same number of columns as
y.
The values stored in the matrices are assumed to be fixed-point or integer
values. All intermediate sums are retained to 32-bit precision, and no overflow
checking is performed. The results are right-shifted by a user-specified
amount, and then truncated to 16 bits.
This is the C equivalent of the assembly code without restrictions. Note that the
assembly code is hand optimized and restrictions may apply.
void DSP_mat_mul(short *x, int r1, int c1, short *y, int c2,
short *r, int qs)
{
int i, j, k;
int sum;
/* −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− */
/*
Multiply each row in x by each column in y.
/*
product of row m in x and column n in y is placed */
/*
in position (m,n) in the result.
/* −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− */
DSP_mat_mul
C64x+ DSPLIB Reference
The
*/
*/
4-73

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tms320c64x+

Table of Contents