![Infineon Technologies XC2200 User Manual Download Page 33](http://html1.mh-extra.com/html/infineon-technologies/xc2200/xc2200_user-manual_2055439033.webp)
XC2200 Derivatives
System Units (Vol. 1 of 2)
Architectural Overview
User’s Manual
2-6
V2.1, 2008-08
ArchitectureX22, V1.1
2.1.3
High Performance Branch-, Call-, and Loop-Processing
Pipelined execution delivers maximum performance with a stream of subsequent
instructions. Any disruption requires the pipeline to be refilled and the new instruction to
step through the pipeline stages. Due to the high percentage of branching in controller
applications, branch instructions have been optimized to require pipeline refilling only in
special cases. This is realized by detecting and preprocessing branch instructions in the
prefetch stage and by predicting the respective branch target address.
Prefetching then continues from the predicted target address. If the prediction was
correct subsequent instructions can be fed to the execution pipeline without a gap, even
if a branch is executed, i.e. the code execution is not linear. Branch target prediction (see
also
) uses the following rules:
•
Unconditional branches:
Branch prediction is trivial in this case, as the branches will
always be taken and the target address is defined. This applies to implicitly
unconditional branches such as JMPS, CALLR, or RET as well as to branches with
condition code “unconditional” such as JMPI cc_UC.
•
Fixed prediction:
Branch instructions which are often used to realize loops are
assumed to be taken if they branch backward to a previous location (the begin of the
loop). This applies to conditional branches such as JMPR cc_XX or JNB.
•
Variable prediction:
In this case the respective prediction (taken or not taken) is
coded into the instruction and can, therefore, be selected for each individual branch
instruction. Thus, the software designer can optimize the instruction flow to the
specific code to be executed
1)
. This applies to the branch instructions JMPA and
CALLA.
•
Conditional indirect branches:
These branches are always assumed to be not
taken. This applies to branch instructions JMPI cc_XX, [Rw] and CALLI cc_XX, [Rw].
The system state information is saved automatically on the internal system stack, thus
avoiding the use of instructions to preserve state upon entry and exit of interrupt or trap
routines. Call instructions push the value of the IP on the system stack, and require the
same execution time as branch instructions. Additionally, instructions have been
provided to support indirect branch and call instructions. This feature supports
implementation of multiple CASE statement branching in assembler macros and high
level languages.
1)
The programming tools accept either dedicated mnemonics for each prediction leaving the choice up to
programmer, or they accept generic mnemonics and apply their own prediction rules.