AN2203 Freescale Semiconductor / Motorola, AN2203 Datasheet - Page 18

no-image

AN2203

Manufacturer Part Number
AN2203
Description
MPC7450 RISC Microprocessor Family Software Optimization Guide
Manufacturer
Freescale Semiconductor / Motorola
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
AN22030A
Manufacturer:
PANASONIC/松下
Quantity:
20 000
Fetch/Branch Considerations
3.1.1.1
The following code loop is a simple array accumulation operation.
xxxxxx18 loop: lwzu r10,0x4(R9)
xxxxxx1C
xxxxxx20
The lwzu and add are the last two instructions in one cache block, and the bdnz is the first instruction in
the next. In this example, the fetch supply is the primary restriction. Table 3-1 assumes instruction cache
and BTIC hits. The lwzu/add of the second iteration are available for dispatch in cycle 3, as a result of a
BTIC hit for the bdnz executed in cycle 1. The bdnz of the second iteration is available in the IQ one cycle
later (cycle 4) because the cache block break forced a fetch from the instruction cache. Overall, the loop is
limited to one iteration for every three cycles.
Performance can be increased if the loop is aligned so that all three instructions are in the same cache block,
as in the following example.
xxxxxx00 loop: lwzu r10,0x4(r9)
xxxxxx04
xxxxxx08
The fact that the loop fits in the same cache block allows the BTIC entry to provide all three instructions.
Table 3-2 shows pipelined execution results (again assuming BTIC and instruction cache hits). While fetch
supply is still a bottleneck, it is improved by proper alignment. The loop is now limited to one iteration every
two cycles, increasing performance by 50 percent.
18
lwzu (1)
add (1)
bdnz (1)
lwzu (2)
add (2)
bdnz (2)
lwzu (3)
add (3)
bdnz (3)
Instruction
Fetch Alignment Example
lwzu (1)
add (1)
bdnz (1)
lwzu (2)
add (2)
bdnz (2)
lwzu (3)
MPC7450 RISC Microprocessor Family Software Optimization Guide
Instruction
add r11,r11,r10
bdnz loop
add r11,r11,r10
bdnz loop
Table 3-2. MPC7450 Loop Example—Three Iterations
F2
D
D
0
Freescale Semiconductor, Inc.
Table 3-1. MPC7450 Fetch Alignment Example
For More Information On This Product,
BE
BE
D
D
1
0
I
I
E0
F1
D
D
2
1
Go to: www.freescale.com
I
I
E1
E0
BE
F2
D
D
D
D
3
2
BE
E2
E1
D
4
3
I
I
I
I
E0
F1
E2
E0
C
D
D
E
5
4
E1
E1
F2
C
C
D
D
C
E
6
5
I
BE
E2
E2
E0
C
C
7
6
I
I
E0
E1
C
D
C
E
E
8
7
E1
E2
C
C
C
C
9
8
E2
10
C
9
MOTOROLA
11
C
E

Related parts for AN2203