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.

5.2.1 Return stack predictions<br />

Program Flow Prediction<br />

Note<br />

Instructions with the S suffix are not predicted. They are typically used to return from<br />

exceptions and have side effects that can change privilege mode and security state.<br />

• ADD(4) with PC destination in Thumb state<br />

• MOV(3) with PC destination in Thumb state<br />

• CPY with PC destination in Thumb state<br />

• CZB in Thumb state<br />

• TBB/TBH in Thumb state<br />

Note<br />

In Thumb state, a branch that is normally encoded as unconditional can be conditioned by<br />

inclusion in an If-Then-Else (ITE) block. Then it is treated as a normal conditional branch.<br />

• HB (ThumbEE state only)<br />

• HBP (ThumbEE state only)<br />

• HBL (ThumbEE state only)<br />

• HBLP (ThumbEE state only).<br />

The HBL and HBLP instructions act as function calls and push the return address onto the<br />

return stack.<br />

The return stack stores the address and the <strong>ARM</strong> or Thumb state of the instruction after a<br />

function-call type branch instruction. This address is equal to the link register value stored in<br />

r14.<br />

The following instructions cause a return stack push if predicted:<br />

• BL immediate<br />

• BLX(1) immediate<br />

• BLX(2) register<br />

• HBL (ThumbEE state)<br />

• HBLP (ThumbEE state).<br />

The following instructions cause a return stack pop if predicted:<br />

• BX r14<br />

• MOV pc, r14<br />

• LDM r13, {…pc}<br />

• LDR pc, [r13]<br />

• LDM r9, {..pc} (ThumbEE state only)<br />

• LDR pc, [r9] (ThumbEE state only).<br />

The LDR instruction can use any of the addressing modes, as long as r13 is the base register.<br />

Additionally, in ThumbEE state you can also use r9 as a stack pointer so the LDR and LDM<br />

instructions with pc as a destination and r9 as a base register are also treated as a return stack<br />

pop.<br />

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

ID060510 Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!