Texas Instruments TMS320C67 DSP Series Programmer's Reference Manual page 80

Library
Hide thumbs Also See for TMS320C67 DSP Series:
Table of Contents

Advertisement

Description
Algorithm
Special Requirements
Implementation Notes
Benchmarks
This routine calculates the dot product of 2 single-precision complex float vec-
tors. The even numbered locations hold the real parts of the complex numbers
while the odd numbered locations contain the imaginary portions.
This is the C equivalent for the assembly code. Note that the assembly code
is hand optimized and restrictions may apply.
void DSPF_sp_dotp_cplx(const float* x, const float* y, int n,
float* restrict re, float* restrict im)
{
float real=0, imag=0;
int i=0;
for(i=0; i<n; i++)
{
real+=(x[2*i]*y[2*i] - x[2*i+1]*y[2*i+1]);
imag+=(x[2*i]*y[2*i+1] + x[2*i+1]*y[2*i]);
}
*re=real;
*im=imag;
}
-
Since single assignment of registers is not used, interrupts should be dis-
abled before this function is called.
-
Loop counter must be even and > 0.
-
The x and y arrays must be double-word aligned.
-
LDDW instructions are used to load two SP floating-point values at a time
for the x and y arrays.
-
A load counter avoids all extraneous loads.
-
Endianess: This code is little endian.
-
Interruptibility: This code is interrupt-tolerant but not interruptible.
Cycles
2*N + 22
e.g., for N = 512, cycles = 1046
Code size
384
(in bytes)
DSPF_sp_dotp_cplx
DSPLIB Reference
4-55

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMS320C67 DSP Series and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents