Motorola once sc140 Manuale Utente

Pagina di 40
Compiler Support on StarCore
26
Introduction to the SC140 Tools
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.
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:
So far, after having modified the code, your best result is:
The optimized C code result is:
If your best result is within 10 percent of the target result, congratulations. You have completed all the 
exercises and the challenge as well.
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.
Original (Inner loop)
Your Best (Inner loop)
Target (Inner loop)
1 cycle with ALUs and AAUs 100 percent used