Branch Prediction - Intel i960 User Manual

Processor compiler
Hide thumbs Also See for i960:
Table of Contents

Advertisement

11
11-10
i960 Processor Compiler User's Guide
This program fragment contains an unconditional branch to the label
directly following the branch. After branch optimization, the branch-
to-next-line sequence is eliminated:
Before
b
.L1
.L1:
In the next program fragment, an unconditional branch follows a
conditional branch. The compiler optimizes this branch sequence by
removing the unconditional branch and reversing the test on the
conditional branch.
Before
cmpi
g1, g2
be
.L1
b .L2
.L1:

Branch Prediction

The i960 Cx and Hx processors provide a branch-prediction bit in
conditional branch instructions. If the prediction is correct, the branch
takes no cycles to execute; otherwise, the branch takes one or more cycles.
For further information on execution speed during branch prediction, refer
to the i960 Cx Microprocessor User's Manual.
If not profiling, the compiler uses these heuristics to set the branch-
prediction bit:
For backward branches (likely a loop), the compiler predicts that the
branch is taken so that the loop is executed more than once.
For forward branches (conditional operations such as
statements), the compiler predicts that the branch is not taken.
During profile-driven compilation, each branch's observed behavior is
used to set the prediction bit.
After
.L1:
After
cmpi
g1, g2
bne
L2
.L1:
if
-
then

Advertisement

Table of Contents
loading

Table of Contents