
TMS320C28x Optimizing C/C++ Compiler v18.12.0.LTS User's Guide Literature Number: SPRU514R August 2001–Revised April 2019 Contents Preface....................................................................................................................................... 10 1 Introduction to the Software Development Tools.................................................................... 13 1.1 Software Development Tools Overview ................................................................................. 14 1.2 Compiler Interface.......................................................................................................... 15 1.3 ANSI/ISO Standard ........................................................................................................ 16 1.4 Output Files ................................................................................................................. 16 1.5 Utilities ....................................................................................................................... 16 2 Using the C/C++ Compiler ................................................................................................... 17 2.1 About the Compiler......................................................................................................... 18 2.2 Invoking the C/C++ Compiler ............................................................................................. 18 2.3 Changing the Compiler's Behavior with Options ....................................................................... 19 2.3.1 Linker Options ..................................................................................................... 26 2.3.2 Frequently Used Options......................................................................................... 28 2.3.3 Miscellaneous Useful Options ................................................................................... 30 2.3.4 Run-Time Model Options......................................................................................... 31 2.3.5 Symbolic Debugging and Profiling Options .................................................................... 34 2.3.6 Specifying Filenames ............................................................................................. 35 2.3.7 Changing How the Compiler Interprets Filenames ........................................................... 35 2.3.8 Changing How the Compiler Processes C Files .............................................................. 35 2.3.9 Changing How the Compiler Interprets and Names Extensions ............................................ 36 2.3.10 Specifying Directories............................................................................................ 36 2.3.11 Assembler Options............................................................................................... 36 2.3.12 Deprecated Options.............................................................................................. 38 2.4 Controlling the Compiler Through Environment Variables............................................................ 38 2.4.1 Setting Default Compiler Options (C2000_C_OPTION) ..................................................... 38 2.4.2 Naming One or More Alternate Directories (C2000_C_DIR) ................................................ 39 2.5 Controlling the Preprocessor ............................................................................................. 39 2.5.1 Predefined Macro Names ........................................................................................ 40 2.5.2 The Search Path for #include Files ............................................................................. 41 2.5.3 Support for the #warning and #warn Directives ............................................................... 42 2.5.4 Generating a Preprocessed Listing File (--preproc_only Option) ........................................... 42 2.5.5 Continuing Compilation After Preprocessing (--preproc_with_compile Option) ........................... 42 2.5.6 Generating a Preprocessed Listing File with Comments (--preproc_with_comment Option) ........... 43 2.5.7 Generating Preprocessed Listing with Line-Control Details (--preproc_with_line Option) ............... 43 2.5.8 Generating Preprocessed Output for a Make Utility (--preproc_dependency Option) ................... 43 2.5.9 Generating a List of Files Included with #include (--preproc_includes Option) ........................... 43 2.5.10 Generating a List of Macros in a File (--preproc_macros Option) ......................................... 43 2.6 Passing Arguments to main()............................................................................................. 43 2.7 Understanding Diagnostic Messages.................................................................................... 44 2.7.1 Controlling Diagnostic Messages ............................................................................... 45 2.7.2 How You Can Use Diagnostic Suppression Options ......................................................... 46 2.8 Other Messages ............................................................................................................ 47 2.9 Generating Cross-Reference Listing Information (--gen_cross_reference Option)................................ 47 2.10 Generating a Raw Listing File (--gen_preprocessor_listing Option)................................................. 48 2.11 Using Inline Function Expansion ......................................................................................... 49 2 Contents SPRU514R–August 2001–Revised April 2019 Submit Documentation Feedback Copyright © 2001–2019, Texas Instruments Incorporated www.ti.com 2.11.1 Inlining Intrinsic Operators ...................................................................................... 50 2.11.2 Inlining Restrictions .............................................................................................. 50 2.11.3 Unguarded Definition-Controlled Inlining...................................................................... 51 2.11.4 Guarded Inlining and the _INLINE Preprocessor Symbol .................................................. 51 2.12 Using Interlist ............................................................................................................... 53 2.13 About the Application Binary Interface .................................................................................. 54 2.14 Enabling Entry Hook and Exit Hook Functions......................................................................... 55 3 Optimizing Your Code......................................................................................................... 56 3.1 Invoking Optimization ...................................................................................................... 57 3.2 Controlling Code Size Versus Speed ................................................................................... 58 3.3 Performing File-Level Optimization (--opt_level=3 option)............................................................ 58 3.3.1 Creating an Optimization Information File (--gen_opt_info Option)......................................... 59 3.4 Program-Level Optimization (--program_level_compile and --opt_level=3 options)............................... 59 3.4.1 Controlling Program-Level Optimization (--call_assumptions Option)...................................... 59 3.4.2 Optimization Considerations When Mixing C/C++ and Assembly .......................................... 60 3.5 Automatic Inline Expansion (--auto_inline Option) ..................................................................... 61 3.6 Link-Time Optimization (--opt_level=4 Option) ......................................................................... 62 3.6.1 Option Handling ................................................................................................... 62 3.6.2 Incompatible Types ............................................................................................... 63 3.7 Using Feedback Directed Optimization.................................................................................. 63 3.7.1 Feedback Directed Optimization ................................................................................ 63 3.7.2 Profile Data Decoder.............................................................................................. 65 3.7.3 Feedback Directed Optimization API ........................................................................... 66 3.7.4 Feedback Directed Optimization Summary .................................................................... 66 3.8 Using Profile Information to Analyze Code Coverage ................................................................. 67 3.8.1 Code Coverage.................................................................................................... 67 3.8.2 Related Features and Capabilities .............................................................................. 68 3.9 Special Considerations When Using Optimization..................................................................... 69 3.9.1 Use Caution With asm Statements in Optimized Code ...................................................... 69 3.9.2 Use the Volatile Keyword for Necessary Memory Accesses ................................................ 69 3.10 Using the Interlist Feature With Optimization........................................................................... 71 3.11 Data Page
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages228 Page
-
File Size-