29.12.2014 Views

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

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>-specific Features<br />

The __ldrex 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 __ldrex((volatile char *)loc);<br />

}<br />

Compiling this code with the command-line option --cpu=6k produces<br />

||foo|| PROC<br />

MOV<br />

LDREXB<br />

BX<br />

ENDP<br />

r0,#0xff<br />

r0,[r0]<br />

lr<br />

See also<br />

• __strex on page 4-89<br />

• LDREX and STREX on page 4-35 in the Assembler <strong>Guide</strong>.<br />

4.7.21 __ldrt<br />

This intrinsic inserts an assembly language instruction of the form LDR{size}T into the<br />

instruction stream generated by the compiler. It enables you to load data from memory<br />

in your C or C++ code using an LDRT instruction.<br />

Syntax<br />

unsigned int __ldrt(const volatile void *ptr)<br />

4-76 Copyright © 2007, 2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0348A<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!