![Intel IXP45X Developer'S Manual Download Page 201](http://html1.mh-extra.com/html/intel/ixp45x/ixp45x_developers-manual_2073092201.webp)
Intel
®
IXP45X and Intel
®
IXP46X Product Line of Network Processors
August 2006
Developer’s Manual
Order Number: 306262-004US
201
Intel XScale
®
Processor—Intel
®
IXP45X and Intel
®
IXP46X Product Line of Network Processors
Please note that the above optimization should only be used in cases where the
multiply operation cannot be advanced far enough to prevent pipeline stalls.
Dividing an unsigned integer by an integer constant should be optimized to make use
of the shift operation whenever possible.
Dividing a signed integer by an integer constant should be optimized to make use of
the shift operation whenever possible.
The add instruction would stall for 1 cycle. The stall can be prevented by filling in
another instruction before add.
3.10.3.5
Effective Use of Addressing Modes
The IXP45X/IXP46X network processors provide a variety of addressing modes that
make indexing an array of objects highly efficient. For a detailed description of these
addressing modes please refer to the ARM* Architecture Reference Manual. The
following code samples illustrate how various kinds of array operations can be
optimized to make use of these addressing modes:
3.10.4
Cache and Prefetch Optimizations
This section considers how to use the various cache memories in all their modes and
then examines when and how to use prefetch to improve execution efficiencies.
3.10.4.1
Instruction Cache
The IXP45X/IXP46X network processors have separate instruction and data caches.
Only fetched instructions are held in the instruction cache even though both data and
instructions may reside within the same memory space with each other. Functionally,
;Multiplication of r0 by an integer constant that can be
;expressed as (2
n
+1)*(2
m
)
add r0, r0, r0, LSL #n
mov r0, r0, LSL #m
;Dividing r0 containing an unsigned value by an integer constant
;that can be represented as 2
n
mov r0, r0, LSR #n
;Dividing r0 containing a signed value by an integer constant
;that can be represented as 2
n
mov r1, r0, ASR #31
add r0, r0, r1, LSR #(32 - n)
mov r0, r0, ASR #n
;Set the contents of the word pointed to by r0 to the value
;contained in r1 and make r0 point to the next word
str r1,[r0], #4
;Increment the contents of r0 to make it point to the next word
;and set the contents of the word pointed to the value contained
;in r1
str r1, [r0, #4]!
;Set the contents of the word pointed to by r0 to the value
;contained in r1 and make r0 point to the previous word
str r1,[r0], #-4
;Decrement the contents of r0 to make it point to the previous
;word and set the contents of the word pointed to the value
;contained in r1
str r1,[r0, #-4]!