Motorola SC140 user manual Local Versus Global Optimization Exercise, Local Optimization

Page 9

Compiler Support on StarCore

3 Local Versus Global Optimization Exercise

The local versus global optimization exercise shows the difference between two C compiler options: local optimization (the default) and global optimization. Local optimization compiles each file of the project individually as represented in Figure 4. Global optimization acts as a global binder that links all the intermediate representation (IR) files into one file before optimizing the application. Since all the application code information is available, this approach enables further optimizations beyond those achieved using local optimization alone. (Compilation takes longer when global optimization is enabled.) Global optimization compilation flow is represented in Figure 5.

StarCore C Compiler

C files

.c, .h

Cfiles

.c, .h

Cfiles

.c, .h

Local

Optimization

Ccompiler Front End

IR files

.obj

Optimizer icode

Ccompiler Front End

IR files

.obj

Optimizer icode

Ccompiler Front End

IR files

.obj

Optimizer

icode

Assembler asmsc100

Assembler asmsc100

Assembler asmsc100

Object library files .elb

Linker

Figure 4. StarCore Local Optimization

Introduction to the SC140 Tools

9

Image 9
Contents Motorola Typical development process is represented in Figure Compiler File I/O Exercise Hands OnGood To Know Interpretation of 16-bit Integer and Fractional Data Values Integer and Fractional Arithmetic ExerciseInteger Arithmetic Compiler Support on StarCoreFractional Arithmetic Good To Know Local Optimization Local Versus Global Optimization ExerciseCompiler Support on StarCore StarCore C Compiler Global Optimization Local OptimizationMemory Alignment Exercise AA BB CC DD First Code Section Second Code Section Split Summation Exercise Code Generated Assembly Code = ∑ a i x n For 0 ≤ n L Multi-Sample ExerciseIntermediate Version Compromise Between Memory and Speed Further Speed Optimization Control Code The True Bit Exercise Save Ex7.c as Ex71.c Calling an Assembly Routine From C Exercise Current Following output should be displayed Challenge Introduction to the SC140 Tools Solutions to ExercisesAligned ExerciseExpected Motorola INC Intermediate version Compromise between Memory and Speed Compiler Support on StarCore Further Optimizing the Speed Compiler Support on StarCore Compiler Support on StarCore Motorola INC Zoffset equ Moffset equ Exercise Compiler Support on StarCore Compiler Support on StarCore AN2009/D