Packed-Data Processing on the 'C64x
8.2.7
Combining Multiple Operations in a Single Instruction
Table 8–5. Intrinsics Which Combine Multiple Operations in one Instruction
Intrinsic
_dotp2
_dotpn2
_dotprsu2
_dotpnrsu2
_dotpu4
_dotpsu4
_max2
_min2
_maxu4
_minu4
_avg2
_avgu4
_subabs4
8-28
The Dot Product and Vector Complex Multiply examples that were presented
earlier were both examples of kernels that benefit from macro operations , that
is, instructions which perform more than a simple operation.
The 'C64x provides a number of instructions which combine common opera-
tions together. These instructions reduce the overall instruction count in the
code, thereby reducing codesize and increasing code density. They also tend
to simplify programming. Some of the more commonly used macro operations
are listed in Table 8–5.
Instruction
DOTP2
DOTPN2
DOTPRSU2
DOTPNRSU2
DOTPU4
DOTPSU4
MAX2
MIN2
MAXU4
MINU4
AVG2
AVGU4
SUBABS4
As you can see, these macro operations can replace a number of separate in-
structions rather easily. For instance, each _dotp2 eliminates an add, and each
Operations combined
Performs two 16x16 multiplies and adds the products
together.
Performs two 16x16 multiplies and subtracts the sec-
ond product from the first.
Performs two 16x16 multiplies, adds products togeth-
er, and shifts/rounds the sum.
Performs two 16x16 multiplies, subtracts the 2nd
product from the 1st, and shifts/rounds the difference.
Performs four 8x8 multiplies and adds products to-
gether.
Compares two pairs of numbers, and selects the
larger/smaller in each pair.
Compares four pairs of numbers, and selects the
larger/smaller in each pair.
Performs two 16-bit additions, followed by a right shift
by 1 with round.
Performs four 8-bit additions, followed a right shift by
1 with round.
Finds the absolute value of the between four pairs of
8-bit numbers.
Need help?
Do you have a question about the TMS320C6000 and is the answer not in the manual?
Questions and answers