Refining C/C++ Code
3-17
Optimizing C/C++ Code
Table 3–6. TMS320C6000 C/C++ Compiler Intrinsics (Continued)
C Compiler Intrinsic
Device
Description
Assembly
Instruction
int _cmpeq4 (int
src1, int src2);
CMPEQ4
Performs equality comparisons on each
pair of 8–bit values. Equality results are
packed into the four least–significant bits
of the return value.
’C64x
int _cmpgt2 (int
src1, int src2);
CMPGT2
Compares each pair of signed 16–bit val-
ues. Results are packed into the two least–
significant bits of the return value.
’C64x
unsigned _cmpgtu4 (uint
src1, uint
src2);
CMPGTU4
Compares each pair of unsigned 8–bit val-
ues. Results are packed into the four
least–significant bits of the return value.
’C64x
unsigned _deal (uint src2);
DEAL
The odd and even bits of src are extracted
into two separate 16–bit values.
’C64x
int _dotp2 (int
src1, int src2);
double _ldotp2 (int
src1, int src2);
DOTP2
LDOTP2
The product of signed lower 16–bit values
of src1 and src2 is added to the product of
signed upper 16–bit values of src1 and
src2.
’C64x
int _dotpn2 (int
src1, int src2);
DOTPN2
The product of signed lower 16–bit values
of src1 and src2 is subtracted from the
product of signed upper 16–bit values of
src1 and src2.
’C64x
int _dotpnrsu2 (int
src1, uint src2);
DOTPNR-
SU2
The product of unsigned lower 16–bit val-
ues in src1 and src2 is subtracted from the
product of signed upper 16–bit values in
src1 and src2. 2
15
is added and the result
is sign shifted right by 16.
’C64x
int _dotprsu2 (int
src1, uint src2);
DOTPR-
SU2
The product of the first signed pair of
16–bit values is added to the product of
the unsigned second pair of 16–bit values
in src1 and src2. 2
15
is added and the re-
sult is sign shifted right by 16.
’C64x
unsigned _dotpu4 (uint
src1, uint src2);
int _dotpsu4 (int
src1, uint src2);
DOTPU4
DOTPSU4
For each pair of 8–bit values in src1 and
src2, the 8–bit value from src1 is multiplied
with the 8–bit value from src2. The four
products are summed together.
’C64x
Note:
Instructions not specified with a device apply to all ’C6000 devices.