Motorola SC140 user manual Challenge, Good To Know

Page 26

Compiler Support on StarCore

13.Are the offsets used in Ex8.c the same as the offsets used in addvecs.asm? If not, can you explain why?

Congratulations, you have completed Exercise 8.

Good To Know

The stack pointer must always be a multiple of 8. It is illegal to increment it by a non-multiple of 8.

9 The Challenge

This section presents you with a challenge involving an example that implements a complex scalar product. The objective of this session is to optimize the code from Ex9.c for speed and obtain the minimum number of cycles.

Hands On

1.Put into practice the techniques previously explained to optimize Ex9.c. The original number of cycles in the inner loop is:

Original (Inner loop)

So far, after having modified the code, your best result is:

Your Best (Inner loop)

The optimized C code result is:

Target (Inner loop)

1 cycle with ALUs and AAUs 100 percent used

If your best result is within 10 percent of the target result, congratulations. You have completed all the exercises and the challenge as well.

26

Introduction to the SC140 Tools

Image 26
Contents Motorola Typical development process is represented in Figure Compiler Good To Know File I/O ExerciseHands On Integer and Fractional Arithmetic Exercise Interpretation of 16-bit Integer and Fractional Data ValuesCompiler Support on StarCore Integer ArithmeticFractional Arithmetic Good To Know Local Versus Global Optimization Exercise Local OptimizationCompiler Support on StarCore StarCore C Compiler Local Optimization Global OptimizationMemory Alignment Exercise AA BB CC DD First Code Section Second Code Section Split Summation Exercise Code Generated Assembly Code Multi-Sample Exercise = ∑ a i x n For 0 ≤ n LIntermediate 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 Solutions to Exercises Introduction to the SC140 ToolsExercise AlignedExpected 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