Packlh2 And _Dotp2 Working Together - Texas Instruments TMS320C6000 Programmer's Manual

Hide thumbs Also See for TMS320C6000:
Table of Contents

Advertisement

Figure 8–20. _packlh2 and _dotp2 Working Together.
The solution is to reorder the halfwords from one of the inputs, so that the imag-
inary component is in the upper halfword and the real component is in the lower
halfword. This is accomplished by using the _packlh2 intrinsic to reorder the
halves of the word. Once the half–words are reordered on one of the inputs,
the _dotp intrinsic provides the appropriate combination of multiplies with an
add to provide the imaginary component of the output.
a
Real
a'
Imaginary
*
b
Real
a_imaginary * b_real
c
a_imag * b_real + a_real * b_imag
Once both the real and imaginary components of the result are calculated, it
is necessary to convert the 32-bit results to 16-bit results and store them. In
the original code, the 32-bit results were shifted right by 16 to convert them to
16-bit results. These results were then packed together with _pack2 for stor-
ing. Our final optimization replaces this shift and pack with a single _packh2.
Example 8–13 shows the result of these optimizations.
Packed-Data Processing on the 'C64x
Imaginary
a' = _packlh2(a, a);
Real
*
Imaginary
a_real * b_imaginary
add
32 bit
'C64x Programming Considerations
c = _dotp2 (b, _packl2(a, a))
8-35

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMS320C6000 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents