Refining C/C++ Code
3-19
Optimizing C/C++ Code
Table 3–6. TMS320C6000 C/C++ Compiler Intrinsics (Continued)
C Compiler Intrinsic
Device
Description
Assembly
Instruction
float _itof(uint);
Reinterprets the bits in the unsigned inte-
ger as a float.
(Ex: _itof(0x3f800000) == 1.0)
double & _memd8(void * ptr);
LDNDW/
STNDW
Allows unaligned loads and stores of 8 by-
tes to memory.
’C64x
int & _mem4(void * ptr);
LDNW/
STNW
Allows unaligned loads and stores of 4 by-
tes to memory.
’C64x
double _ldotp2 (int
src1, int src2);
int _dotp2 (int
src1, int src2);
LDOTP2
DOTP2
The product of the lower signed 16–bit val-
ues in src1 and src2 are added to the prod-
uct of the upper signed 16–bit values in
src1 and src2. In the ldotp2 vecsum, the
result is sign extended to 64 bits.
’C64x
uint _lmbd(uint s
rc1, uint src2);
LMBD
Searches for a leftmost 1 or 0 of src2 deter-
mined by the LSB of src1. Returns the
number of bits up to the bit change.
uint _lo(double);
Returns the low (even) register of a double
register pair as an integer.
int _max2 (int
src1, int src2);
int _min2 (int
src1, int src2);
unsigned _maxu4 (uint
src1, uint src2);
unsigned _minu4 (uint
src1, uint src2);
MAX2
MIN2
MAXU4
MINU4
Places the larger/smaller of each pair of
values in the corresponding position in the
return value. Values can be 16–bit signed
or 8–bit unsigned.
’C64x
double _mpy2 (int
src1, int src2);
MPY2
Returns the products of the lower and
higher 16–bit values in src1 and src2.
’C64x
double _mpyhi (int
src1, int src2);
double _mpyli (int
src1, int src2);
MPYHI
MPYLI
Produces a 16 by 32 multiply. The result is
placed into the lower 48 bits of the returned
double. Can use the upper or lower 16 bits
of src1.
’C64x
int _mpyhir (int
src1, int src2);
int_mpylir (int
src1, int src2);
MPYHIR
MPYLIR
Produces a signed 16 by 32 multiply. The
result is shifted right by 15 bits. Can use
the upper or lower 16 bits of src1.
’C64x
double _mpysu4 (int
src1, uint src2);
double _mpyu4 (uint
src1, uint src2);
MPYSU4
MPYU4
For each 8–bit quantity in src1 and src2,
performs an 8–bit by 8–bit multiply. The
four 16–bit results are packed into a
double. The results can be signed or un-
signed.
’C64x
Note:
Instructions not specified with a device apply to all ’C6000 devices.