General Guidelines
As an example of the usage of the
sums two input parameters and returns the result.
inline int add(int a, int b) {
return (a+b);
}
Good: use of the
Inlining has a code-size to performance trade-off that should be consid-
ered when it is used. With
small functions where possible. If the application has a tight upper
code-size limit, the resulting code-size expansion may be too great. It is
worth considering using automatic inlining in conjunction with the
switch
(on page
code-size cost) to parts of the application that are performance-critical.
This will be considered in more detail later in this chapter.
Using Inline asm Statements
The compiler allows use of inline
assembly into C code.
Tip: Avoid use of inline
may be used instead
The compiler does not intensively optimize code that contains inline
statements because it has little understanding about what the code in the
statement does. In particular, use of an
inhibit useful transformations.
The compiler has been enhanced with a large number of built-in func-
tions. These generate specific hardware instructions and are designed to
allow the programmer to more finely tune the code produced by the com-
2-14
inline
keyword.
inline
, the compiler will automatically inline
-Oa
1-38) to restrict inlining (and other optimizations with a
asm
asm
VisualDSP++ 3.5 C/C++ Compiler and Library Manual
keyword, the function below
statements to insert small sections of
statements where built-in functions
statement in a loop may
asm
for ADSP-219x DSPs
-Ov n
asm
Need help?
Do you have a question about the VISUALDSP++ 3.5 and is the answer not in the manual?
Questions and answers