C66-C Optimisation 22 (1)

Telechargé par nasser ouardaoui
C and System
Optimizations
!
!"#$
1. Intrinsics
2. Directives de compilation : Pragmas
3. Options Compilateurs
"
%&'()(*#'(+$,-,.,
/$'0($*(1* .,,/$'203#4#52,67,898::,2',
62,";#**2)<"270,
#
/$'0($*(1*
$%&'()*+()&,-.%& /%+0%**%)*'12%3/+(0%+'1%&'()&*+.4*(5)&'
6&&%078%.+'16)&'8%'451%'%)'!"#
988%&'&5)*'.*(8(&:%&'%&*'6//%8:%&'%364*%0%)*'4500%'1%&'
;5)4*(5)&'486&&(-.%&'1.'!<
988%&'&5)*'&/:4(;(:&'6=%4'.)'*+6(*'1%'&5.8(>)%0%)*'?'_@
988%&'/%+0%**%)*'1A%3/+(0%+'86'&(>)(;(46*(5)'1%'4%+*6()%&'
()&*+.4*(5)&'1A6&&%078%.+'-.('&%+6(%)*'6.*+%0%)*'85.+1%&'
5.'()%3/+(0678%&'%)'B'
$%&'()&*#+
B51%'%)'B'C' y=a*bD
B51%'%)'B'.*(8(&6)*'8%&';5)4*(5)&'()*+()&,-.%& C
y'='_mpy (a,'b);
()* 3!E'3"E'FD y'='_mpy32(x1,'x2);'//'x1*x2G
Interfacing C and C++ With Assembly Language
www.ti.com
Table 7-5. TMS320C6000 C/C++ Compiler Intrinsics (continued)
Assembly
C/C++ Compiler Intrinsic Instruction Description
unsigned _extur (unsigned src2,int src1); EXTU Extracts the specified field in src2, zero-extended to 32 bits. The
extract is performed by a shift left followed by a unsigned shift right;
the shift left and shift right amounts are specified by the lower 10
bits of src1.
unsigned _ftoi (float src); Reinterprets the bits in the float as an unsigned. For example:
_ftoi (1.0) == 1065353216U
unsigned _hi (double src); Returns the high (odd) register of a double register pair
unsigned _hill (long long src); Returns the high (odd) register of a long long register pair
double _itod (unsigned src2,unsigned src1); Builds a new double register pair by reinterpreting two unsigned
values, where src2 is the high (odd) register and src1 is the low
(even) register
float _itof (unsigned src); Reinterprets the bits in the unsigned as a float. For example:
_itof (0x3f800000) = 1.0
long long _itoll (unsigned src2,unsigned src1); Builds a new long long register pair by reinterpreting two unsigned
values, where src2 is the high (odd) register and src1 is the low
(even) register
unsigned _lmbd (unsigned src1,unsigned src2); LMBD Searches for a leftmost 1 or 0 of src2 determined by the LSB of
src1. Returns the number of bits up to the bit change.
unsigned _lo (double src); Returns the low (even) register of a double register pair
unsigned _loll (long long src); Returns the low (even) register of a long long register pair
double _ltod (__int40_t src); Reinterprets an __int40_t register pair src as a double register pair.
double _lltod (long long src); Reinterprets long long register pair src as a double register pair.
int _mpy (int src1,int src2); MPY Multiplies the 16 LSBs of src1 by the 16 LSBs of src2 and returns
int _mpyus (unsigned src1,int src2); MPYUS the result. Values can be signed or unsigned.
int _mpysu (int src1,unsigned src2); MPYSU
unsigned _mpyu (unsigned src1,unsigned src2); MPYU
int _mpyh (int src1,int src2); MPYH Multiplies the 16 MSBs of src1 by the 16 MSBs of src2 and returns
int _mpyhus (unsigned src1,int src2); MPYHUS the result. Values can be signed or unsigned.
int _mpyhsu (int src1,unsigned src2); MPYHSU
unsigned _mpyhu (unsigned src1,unsigned src2); MPYHU
int _mpyhl (int src1,int src2); MPYHL Multiplies the 16 MSBs of src1 by the 16 LSBs of src2 and returns
int _mpyhuls (unsigned src1,int src2); MPYHULS the result. Values can be signed or unsigned.
int _mpyhslu (int src1,unsigned src2); MPYHSLU
unsigned _mpyhlu (unsigned src1,unsigned src2); MPYHLU
int _mpylh (int src1,int src2); MPYLH Multiplies the 16 LSBs of src1 by the 16 MSBs of src2 and returns
int _mpyluhs (unsigned src1,int src2); MPYLUHS the result. Values can be signed or unsigned.
int _mpylshu (int src1,unsigned src2); MPYLSHU
unsigned _mpylhu (unsigned src1,unsigned src2); MPYLHU
void _nassert (int src); Generates no code. Tells the optimizer that the expression declared
with the assert function is true; this gives a hint to the optimizer as
to what optimizations might be valid.
unsigned _norm (int src); NORM Returns the number of bits up to the first nonredundant sign bit of
unsigned _lnorm (__int40_t src); src
int _sadd (int src1,int src2); SADD Adds src1 to src2 and saturates the result. Returns the result.
long _lsadd (int src1,__int40_t src2);
int _sat (__int40_t src2); SAT Converts a 40-bit long to a 32-bit signed int and saturates if
necessary.
unsigned _set (unsigned src2,unsigned csta ,SET Sets the specified field in src2 to all 1s and returns the src2 value.
unsigned cstb); The beginning and ending bits of the field to be set are specified by
csta and cstb, respectively.
unsigned _setr (unit src2,int src1); 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 specified by
the lower ten bits of src1.
int _smpy (int src1,int src2); SMPY Multiplies src1 by src2, left shifts the result by 1, and returns the
int _smpyh (int src1,int src2); SMPYH result. If the result is 0x80000000, saturates the result to
int _smpyhl (int src1,int src2); SMPYHL 0x7FFFFFFF
int _smpylh (int src1,int src2); SMPYLH
222 Run-Time Environment SPRU187VMarch 2014
Submit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated
H
1 / 44 100%

C66-C Optimisation 22 (1)

Telechargé par nasser ouardaoui
La catégorie de ce document est-elle correcte?
Merci pour votre participation!

Faire une suggestion

Avez-vous trouvé des erreurs dans linterface ou les textes ? Ou savez-vous comment améliorer linterface utilisateur de StudyLib ? Nhésitez pas à envoyer vos suggestions. Cest très important pour nous !