09.12.2012 Views

Cortex-A8 Technical Reference Manual - ARM Information Center

Cortex-A8 Technical Reference Manual - ARM Information Center

Cortex-A8 Technical Reference Manual - ARM Information Center

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

16.2.10 Branch instructions<br />

Instruction Cycle Timing<br />

Any write to the PC is considered a branch. This section describes both standard B branch<br />

instructions in addition to different instruction types with the PC as the destination register. In<br />

general, branch instructions schedule very well and have very few hazards that prevent<br />

superscalar issue. There are several properties to the execution of branches that make them<br />

behave differently than other instructions.<br />

Conditional branches<br />

Conditional branches are executed differently than other conditional instructions. Most<br />

conditional instructions take the destination register as an additional source and the condition<br />

codes are resolved in E2. Branches do not require the destination register, PC, as an additional<br />

source because they already use the PC as a source. They are also different than normal<br />

conditional operations because the flags resolve the condition codes in E3 rather than E2. This<br />

enables the pairing of a flag setting instruction and a branch in the same cycle.<br />

Branches with the PC as a source or destination<br />

Using the PC as a source register does not generally result in scheduling hazards as for the case<br />

of a general-purpose register. This is because the PC values are predicted in the pipeline and are<br />

readily available to each instruction without any forwarding required. The only exception to this<br />

rule is that an instruction with a PC as a source register cannot be dual issued with an instruction<br />

that uses the PC as a destination register.<br />

Other than the dual issue restriction, using the PC as a destination register does not result in a<br />

hazard for subsequent instructions for the same reason.<br />

Data processing-based branches<br />

Data processing branches can have the same data hazards of nonbranch versions of these<br />

instructions for operands other than the PC.<br />

Load-based branches<br />

An LDR PC or LDM PC instruction behaves like a normal load with the exception that it requires<br />

one additional cycle to execute.<br />

Table 16-11 shows the behavior of branch instructions.<br />

Table 16-11 Branch instructions<br />

Shift type Cycles Source1 Source2 Source3 Source4 Result1 Result2<br />

BCC 1 [Flags:E3] - - - R15:E4 a -<br />

BLCC, BLX 1 [Flags:E3] - - - R14:E3 R15:E4 a<br />

BXCC 1 [Flags:E3] Rm:E2 - - - -<br />

Data-processing branch b Typically 1 c [Flags:E3] - - - R15:E4 a -<br />

Load-based branch Basic load<br />

plus one<br />

cycle d<br />

[Flags:E3] - - - (Rn:E2) -<br />

a. Branch prediction resolution in E4.<br />

b. ADD PC, R1, R2 and MOV PC, R4 are both examples of data-processing branches.<br />

c. See Data-processing instructions on page 16-4 for more information on cycle counts and source registers.<br />

<strong>ARM</strong> DDI 0344K Copyright © 2006-2010 <strong>ARM</strong> Limited. All rights reserved. 16-9<br />

ID060510 Non-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!