Refining C/C++ Code
3-16
Table 3–6 lists the ’C6000 intrinsics. For more information on using intrinsics,
see the
TMS320C6000 Optimizing C/C++ Compiler User’s Guide.
Table 3–6. TMS320C6000 C/C++ Compiler Intrinsics
C Compiler Intrinsic
Assembly
Instruction
Description
Device
int _abs(int
src2);
int_labs(long
src2);
ABS
Returns the saturated absolute value of
src2.
int _abs2 (int src2);
ABS2
Calculates the absolute value for each
16–bit value.
’C64x
int _add2(int
src1, int src2);
ADD2
Adds the upper and lower halves of src1 to
the upper and lower halves of src2 and re-
turns the result. Any overflow from the low-
er half add will not affect the upper half
add.
int _add4 (int
src1, int src2);
ADD4
Performs 2s–complement addition to pairs
of packed 8–bit numbers.
’C64x
int _avg2 (int
src1, int src2);
AVG2
Calculates the average for each pair of
signed 16–bit values.
’C64x
unsigned _avgu4(uint
src1, uint src2);
AVGU4
Calculates the average for each pair of un-
signed 8–bit values.
’C64x
unsigned _bitc4 (uint src2);
BITC4
For each of the 8–bit quantities in src, the
number of 1 bits is written to the corre-
sponding position in the return value.
’C64x
unsigned _bitr (uint src2);
BITR
Reverses the order of the bits.
’C64x
uint _clr(uint
src2, uint csta, uint cstb);
CLR
Clears the specified field in src2. The be-
ginning and ending bits of the field to be
cleared are specified by csta and cstb, re-
spectively.
unsigned _clrr(uint
src1, int src2);
CLR
Clears the specified field in src2. The be-
ginning and ending bits of the field to be
cleared are specified by the lower 10 bits
of the source register.
int _cmpeq2 (int
src1, int src2);
CMPEQ2
Performs equality comparisons on each
pair of 16–bit values. Equality results are
packed into the two least–significant bits of
the return value.
’C64x
Note:
Instructions not specified with a device apply to all ’C6000 devices.