![Intel IXP45X Скачать руководство пользователя страница 220](http://html1.mh-extra.com/html/intel/ixp45x/ixp45x_developers-manual_2073092220.webp)
Intel
®
IXP45X and Intel
®
IXP46X Product Line of Network Processors—Intel XScale
®
Processor
Intel
®
IXP45X and Intel
®
IXP46X Product Line of Network Processors
Developer’s Manual
August 2006
220
Order Number: 306262-004US
The ORR instruction above would incur a one cycle stall due to the two-cycle result
latency of the MRS instruction. In the code example above, the ADD instruction can be
moved before the ORR instruction to prevent this stall.
3.10.5.8
Scheduling CP15 Coprocessor Instructions
The MRC instruction has an issue latency of one cycle and a result latency of three
cycles. The MCR instruction has an issue latency of one cycle.
Consider the code sample:
The MOV instruction above would incur a two-cycle latency due to the three-cycle
result latency of the mrc instruction. The code shown above can be rearranged as
follows to avoid these stalls:
3.10.6
Optimizing C Libraries
Many of the standard C library routines can benefit greatly by being optimized for the
IXP45X/IXP46X network processors’ architecture. The following string and memory
manipulation routines should be tuned to obtain the best performance from the
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
3.10.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 will,
in general, lower the performance of your application. This section contains techniques
for optimizing for code size using the instruction set for the IXP45X/IXP46X network
processors.
3.10.7.1
Space/Performance Trade Off
Many optimizations mentioned in the previous sections improve the performance of
Intel
®
StrongARM
*
code. However, using these instructions will result in increased code
size. Use the following optimizations to reduce the space requirements of the
application code.
3.10.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.
add r1, r2, r3
mrc p15, 0, r7, C1, C0, 0
mov r0, r7
add r1, r1, #1
mrc p15, 0, r7, C1, C0, 0
add r1, r2, r3
add r1, r1, #1
mov r0, r7