Intel Processor Computer Hardware User Manual


 
Developers Manual March, 2003 B-45
Intel
®
80200 Processor based on Intel
®
XScale
Microarchitecture
Optimization Guide
B.6 Optimizing C Libraries
Many of the standard C library routines can benefit greatly by being optimized for the Intel
®
80200
processor architecture. The following string and memory manipulation routines should be tuned to
obtain the best performance from the Intel
®
80200 processor architecture (instruction selection,
cache usage and data prefetch):
strcat, strchr, strcmp, strcoll, strcpy, strcspn, strlen, strncat, strncmp, strpbrk, strrchr, strspn,
strstr, strtok, strxfrm, memchr, memcmp, memcpy, memmove, memset
B.7 Optimizations for Size
For applications such as cell phone software it is necessary to optimize the code for improved
performance while minimizing code size. Optimizing for smaller code size, in general, lowers the
performance of your application. This chapter contains techniques for optimizing for code size
using the Intel
®
80200 processor instruction set.
B.7.1 Space/Performance Trade Off
Many optimizations mentioned in the previous chapters improve the performance of ARM code.
However, using these instructions results in increased code size. Use the following optimizations to
reduce the space requirements of the application code.
B.7.1.1. Multiple Word Load and Store
The LDM/STM instructions are one word long and let you load or store multiple registers at once.
Use the LDM/STM instructions instead of a sequence of loads/stores to consecutive addresses in
memory whenever possible.
B.7.1.2. Use of Conditional Instructions
Using conditional instructions to expand if-then-else statements as described in Section B.3.1,
“Conditional Instructions” results in increasing the size of the generated code. Therefore, do not
use conditional instructions if application code space requirements are an issue.
B.7.1.3. Use of PLD Instructions
The preload instruction PLD is only a hint, it does not change the architectural state of the
processor. Using or not using them will not change the behavior of your code, therefore, you should
avoid using these instructions when optimizing for space.