A pipelined CPU includes a pre-fetch (PF) stage for performing branch prediction,
and an instruction fetch (IF) stage for fetching instructions that are to be later
processed by an execution (EX) stage. The PF stage has a PF address (PFA) register
for storing the address of an instruction being processed by the PF stage, and
the IF stage has an IF address (IFA) register for storing the address of an instruction
to be fetched for later execution. The CPU also includes address register control
(ARC) circuitry for setting the contents of the PFA and the IFA. The ARC accepts
branch-prediction results from the PF stage to determine the subsequent contents
of the PFA and the IFA. If the PF stage predicts a branch, then the ARC sets the
next address of the PFA to be sequentially after a predicted branch address, and
simultaneously sets the next address of the IFA to be the predicted branch address.