29.10.2014 Views

ARM Compiler toolchain v4.1 for µVision Using the Compiler

ARM Compiler toolchain v4.1 for µVision Using the Compiler

ARM Compiler toolchain v4.1 for µVision Using the Compiler

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>Compiler</strong> Features<br />

4.6 <strong>Compiler</strong> intrinsics <strong>for</strong> inserting optimization barriers<br />

The compiler can per<strong>for</strong>m a range of optimizations, including re-ordering instructions and<br />

merging some operations. In some cases, such as system level programming where memory is<br />

being accessed concurrently by multiple processes, it might be necessary to disable instruction<br />

re-ordering and <strong>for</strong>ce memory to be updated.<br />

The optimization barrier intrinsics __schedule_barrier, __<strong>for</strong>ce_stores and __memory_changed<br />

do not generate code, but <strong>the</strong>y can result in slightly increased code size and additional memory<br />

accesses.<br />

Note<br />

On some systems <strong>the</strong> memory barrier intrinsics might not be sufficient to ensure memory<br />

consistency. For example, <strong>the</strong> __memory_changed intrinsic <strong>for</strong>ces values held in registers to be<br />

written out to memory. However, if <strong>the</strong> destination <strong>for</strong> <strong>the</strong> data is held in a region that can be<br />

buffered it might wait in a write buffer. In this case you might also have to write to CP15 or use<br />

a memory barrier instruction to drain <strong>the</strong> write buffer. See <strong>the</strong> Technical Reference Manual <strong>for</strong><br />

your <strong>ARM</strong> processor <strong>for</strong> more in<strong>for</strong>mation.<br />

4.6.1 See also<br />

Reference<br />

<strong>Compiler</strong> Reference:<br />

• __<strong>for</strong>ce_stores intrinsic on page 5-68<br />

• __memory_changed intrinsic on page 5-72<br />

• __schedule_barrier intrinsic on page 5-78.<br />

O<strong>the</strong>r in<strong>for</strong>mation<br />

The Technical Reference Manual <strong>for</strong> your <strong>ARM</strong> processor.<br />

<strong>ARM</strong> DUI 0375C Copyright © 2007-2008, 2011 <strong>ARM</strong>. All rights reserved. 4-9<br />

ID061811<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!