Refining C/C++ Code
3-21
Optimizing C/C++ Code
Table 3–6. TMS320C6000 C/C++ Compiler Intrinsics (Continued)
C Compiler Intrinsic
Device
Description
Assembly
Instruction
double _rcpdp(double);
RCPDP
Computes the approximate 64-bit double
reciprocal.
’C67x
float _rcpsp(float);
RCPSP
Computes the approximate 64-bit double
reciprocal.
’C67x
unsigned _rotl (uint
src2, uint src1);
ROTL
Rotates src2 to the left by the amount in
src1.
’C64x
double _rsqrdp(double
src);
RSQRDP
Computes the approximate 64-bit double
reciprocal square root.
’C67x
float _rsqrsp(float
src);
RSQRSP
Computes the approximate 32-bit float re-
ciprocal square root.
’C67x
int _sadd(int
src1, int src2);
long lsadd(int
src1 long src2):
SADD
Adds src1 to src2 and saturates the result.
Returns the result
long _lsadd(int
src1, long src2):
Returns the result.
unsigned _saddu4 (uint
src1, uint src2);
SADDU4
Performs saturated addition between
pairs of 8-bit unsigned values in src1 and
src2.
’C64x
int _sadd2 (int
src1, int src2);
int _saddus2 (uint
src1, int src2);
SADD2
SADDUS2
Performs saturated addition between
pairs of 16–bit values in src1 and src2.
Src1 values can be signed or unsigned.
’C64x
int _sat(long
src2);
SAT
Converts a 40-bit value to an 32-bit value
and saturates if necessary.
uint _set(uint
src2, uint csta, uint cstb);
SET
Sets the specified field in src2 to all 1s and
returns the src2 value. The beginning and
ending bits of the field to be set are speci-
fied by csta and cstb, respectively.
unsigned _setr(uint, int);
SET
Sets the specified field in src2 to all 1s and
returns the src2 value. The beginning and
ending bits of the field to be set are speci-
fied by the lower ten bits of the source reg-
ister.
unsigned _shfl (uint src2);
SHFL
The lower 16 bits of src are placed in the
even bit positions, and the upper 16 bits of
src are placed in the odd bit positions.
’C64x
Note:
Instructions not specified with a device apply to all ’C6000 devices.