05.02.2013 Views

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

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.

<strong>ARM</strong>v4 <strong>and</strong> <strong>ARM</strong>v5 Differences<br />

H.3 Application level memory support<br />

Memory support covers address alignment, endian support, semaphore support, memory type, memory<br />

order model, caches, <strong>and</strong> write buffers.<br />

H.3.1 Alignment<br />

<strong>ARM</strong>v4 <strong>and</strong> <strong>ARM</strong>v5 behave differently from <strong>ARM</strong>v7 for unaligned memory accesses. The behavior is the<br />

same as <strong>ARM</strong>v6 legacy mode except for forcing alignment checks with SCTLR.A == 1.<br />

For more information about the SCTLR see c1, System Control Register (SCTLR) on page AppxH-39.<br />

For <strong>ARM</strong> instructions when SCTLR.A == 0:<br />

Non halfword-aligned LDRH, LDRSH, <strong>and</strong> STRH are UNPREDICTABLE.<br />

Non word-aligned LDR, LDRT, <strong>and</strong> the load access of a SWP rotate right the word-aligned data transferred<br />

by a non word-aligned address one, two, or three bytes depending on the value of address[1:0].<br />

Non word-aligned STR, STRT, <strong>and</strong> the store access of a SWP ignore address[1:0].<br />

From <strong>ARM</strong>v5TE, it is IMPLEMENTATION DEFINED whether LDRD <strong>and</strong> STRD must be<br />

doubleword-aligned or word-aligned. LDRD <strong>and</strong> STRD instructions that do not meet the alignment<br />

requirement are UNPREDICTABLE.<br />

Non word-aligned LDM, LDC, LDC2, <strong>and</strong> POP ignore address[1:0].<br />

Non word-aligned STM, STC, STC2, <strong>and</strong> PUSH ignore address[1:0].<br />

For Thumb instructions when SCTLR.A == 0:<br />

Non halfword-aligned LDRH, LDRSH, <strong>and</strong> STRH are UNPREDICTABLE.<br />

Non word-aligned LDR, <strong>and</strong> STR are UNPREDICTABLE.<br />

Non word-aligned LDMIA, <strong>and</strong> POP ignore address[1:0].<br />

Non word-aligned STMIA, <strong>and</strong> PUSH ignore address[1:0].<br />

For <strong>ARM</strong> <strong>and</strong> Thumb instructions, alignment checking is defined for implementations supporting CP15,<br />

specifically the SCTLR.A bit. When this bit is set, a Data Abort exception indicating an Alignment fault is<br />

generated for unaligned accesses. When SCTLR.A = 1, whether the alignment check for an LDRD or STRD<br />

instruction is for doubleword-alignment or word-alignment depends on the implementation choice of which<br />

alignments are supported for these instructions when SCTLR.A = 0.<br />

Note<br />

The option of word alignment for LDRD <strong>and</strong> STRD instructions is not permitted in the <strong>ARM</strong>v6 legacy<br />

configuration where SCTLR.U == 0 <strong>and</strong> SCTLR.A == 1. For more information, see legacy alignment<br />

support in Alignment on page AppxG-6.<br />

AppxH-6 Copyright © 1996-1998, 2000, 2004-2008 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DDI 0406B

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

Saved successfully!

Ooh no, something went wrong!