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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Compiler-specific Features<br />

The __strex 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(!__strex(0x20, (volatile char *)loc));<br />

}<br />

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

||foo|| PROC<br />

MOV<br />

MOV<br />

STREXB<br />

RSBS<br />

MOVCC<br />

BX<br />

ENDP<br />

r0,#0xff<br />

r2,#0x20<br />

r1,r2,[r0]<br />

r0,r1,#1<br />

r0,#0<br />

lr<br />

See also<br />

• __ldrex on page 4-84<br />

• __ldrexd on page 4-86<br />

• __strexd<br />

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

4.7.37 __strexd<br />

This intrinsic inserts an STREXD instruction into the instruction stream generated by the<br />

compiler. It enables you to use an STREXD instruction in your C or C++ code to store data<br />

to memory. It supports exclusive stores of doubleword data to memory.<br />

Syntax<br />

int __strexd(unsigned long long val, volatile void *ptr)<br />

Where:<br />

val<br />

is the value to be written to memory.<br />

4-102 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!