Refining C/C++ Code
3-23
Optimizing C/C++ Code
Table 3–6. TMS320C6000 C/C++ Compiler Intrinsics (Continued)
C Compiler Intrinsic
Device
Description
Assembly
Instruction
int _sub2(int
src1, int src2);
SUB2
Subtracts the upper and lower halves of
src2 from the upper and lower halves of
src1, and returns the result. Any borrowing
from the lower half subtract does not affect
the upper half subtract.
int _sub4 (int
src1, int src2);
SUB4
Performs 2s–complement subtraction be-
tween pairs of packed 8–bit values.
’C64x
int _subabs4 (int
src1, int src2);
SUBABS4
Calculates the absolute value of the differ-
ences for each pair of packed 8–bit values.
’C64x
uint _swap4 (uint src2);
SWAP4
Exchanges pairs of bytes (an endian
swap) within each 16–bit value.
’C64x
uint _unpkhu4 (uint src2);
UNPKHU4
Unpacks the two high unsigned 8–bit val-
ues into unsigned packed 16–bit values.
’C64x
uint _unpklu4 (uint src2);
UNPKLU4
Unpacks the two low unsigned 8–bit val-
ues into unsigned packed 16–bit values.
’C64x
uint _xpnd2 (uint src2);
XPND2
Bits 1 and 0 of src are replicated to the up-
per and lower halfwords of the result, re-
spectively.
’C64x
uint _xpnd4 (uint src2);
XPND4
Bits 3 through 0 are replicated to bytes 3
through 0 of the result.
’C64x
Note:
Instructions not specified with a device apply to all ’C6000 devices.