Refining C/C++ Code
3-20
Table 3–6. TMS320C6000 C/C++ Compiler Intrinsics (Continued)
C Compiler Intrinsic
Device
Description
Assembly
Instruction
int _mpy(int
src1, int src2);
int _mpyus(uint
src1, int src2);
int _mpysu(int
src1, uint src2);
uint _mpyu(uint
src1, uint src2);
MPY
MPYUS
MPYSU
MPYU
Multiplies the 16 LSBs of src1 by the 16
LSBs of src2 and returns the result. Values
can be signed or unsigned.
int _mpyh(int
src1, int src2);
int _mpyhus(uint
src1, int src2);
int _mpyhsu(int
src1, uint src2);
uint _mpyhu(uint
src1, uint src2);
MPYH
MPYHUS
MPYHSU
MPYHU
Multiplies the 16 MSBs of
src1 by the 16
MSBs of src2 and returns the result. Val-
ues can be signed or unsigned.
int _mpyhl(int
src1, int src2);
int _mpyhuls(uint
src1, int src2);
int _mpyhslu(int
src1, uint src2);
uint _mpyhlu(uint
src1, uint src2);
MPYHL
MPYHULS
MPYHSLU
MPYHLU
Multiplies the 16 MSBs of src1 by the 16
LSBs of src2 and returns the result. Values
can be signed or unsigned.
int _mpylh(int
src1, int src2);
int _mpyluhs(uint
src1, int src2);
int _mpylshu(int
src1, uint src2);
uint _mpylhu(uint
src1, uint src2);
MPYLH
MPYLUHS
MPYLSHU
MPYLHU
Multiplies the 16 LSBs of src1 by the 16
MSBs of src2 and returns the result. Val-
ues can be signed or unsigned.
int _mvd (int src2);
MVD
Moves the data from the src to the return
value over 4 cycles using the multipler
pipeline.
’C64x
void _nassert(int);
Generates no code. Tells the optimizer
that the expression declared with the
assert function is true. This gives a hint to
the compiler as to what optimizations
might be valid (word-wide optimizations).
uint _norm(int
src2);
uint lnorm(long
src2);
NORM
Returns the number of bits up to the first
nonredundant sign bit of src2
uint _lnorm(long
src2);
nonredundant sign bit of src2.
unsigned _pack2 (uint
src1, uint src2);
unsigned _packh2 (uint
src1, uint src2);
PACK2
PACKH2
The lower/upper half–words of src1 and
src2 are placed in the return value.
’C64x
unsigned _packh4 (uint
src1, uint src2);
unsigned _packl4 (uint
src1, uint src2);
PACKH4
PACKL4
Packs alternate bytes into return value.
Can pack high or low bytes.
’C64x
unsigned _packhl2 (uint
src1, uint src2);
unsigned _packlh2 (uint
src1, uint src2);
PACKHL2
PACKLH2
The upper/lower half–word of src1 is
placed in the upper half–word the return
value. The lower/upper half–word of src2
is placed in the lower half–word the return
value.
’C64x
Note:
Instructions not specified with a device apply to all ’C6000 devices.