Compiler intrinsics for inserting
optimization barriers
The compiler can perform a range of optimizations, including
re-ordering instructions and merging some operations. In some cases,
such as system level programming where memory is being accessed
concurrently by multiple processes, it might be necessary to disable
instruction re-ordering and force memory to be updated.
The optimization barrier intrinsics __schedule_barrier, __force_stores and __memory_changed do
not generate code, but they can result in slightly increased code
size and additional memory accesses.
Note
On some systems the memory barrier intrinsics might not be
sufficient to ensure memory consistency. For example, the __memory_changed intrinsic
forces values held in registers to be written out to memory. However,
if the destination for the data is held in a region that can be buffered
it might wait in a write buffer. In this case you might also have
to write to CP15 or use a memory barrier instruction to drain the
write buffer. See the Technical Reference Manual for your ARM processor
for more information.
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.