04.01.2015 Views

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Compiler-specific Features<br />

Return value<br />

The __ldrt intrinsic returns the data loaded from the memory address pointed to by ptr.<br />

Errors<br />

The compiler does not recognize the __ldrt intrinsic when compiling for a target that<br />

does not support the LDRT instruction. The compiler generates either a warning or an<br />

error in this case.<br />

The __ldrt intrinsic does not support access to doubleword data. The compiler<br />

generates an error if you specify an access width that is not supported.<br />

Example<br />

int foo(void)<br />

{<br />

int loc = 0xff;<br />

return __ldrt((const volatile int *)loc);<br />

}<br />

Compiling this code with the default options produces:<br />

||foo|| PROC<br />

MOV r0,#0xff<br />

LDRBT r1,[r0],#0<br />

MOV r2,#0x100<br />

LDRBT r0,[r2],#0<br />

ORR r0,r1,r0,LSL #8<br />

BX lr<br />

ENDP<br />

See also<br />

• --thumb on page 2-122<br />

• LDR and STR (User mode) on page 4-18 in the Assembler Guide.<br />

4.7.17 __memory_changed<br />

This intrinsic causes all variables that are visible outside the current function, such as<br />

variables that have pointers to them passed into or out of the function, to be written back<br />

to memory if they have been changed, and then to be read back from memory.<br />

This intrinsic also acts as a scheduling barrier.<br />

4-88 Copyright © 2007-2010 <strong>ARM</strong>. All rights reserved. <strong>ARM</strong> DUI 0348C<br />

Non-Confidential,<br />

ID101213

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

Saved successfully!

Ooh no, something went wrong!