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 />

sat must be in the range 1 to 32.<br />

Return value<br />

The __ssat intrinsic returns val saturated to the signed range –2 sat–1 ≤ x ≤ 2 sat–1 –1.<br />

Errors<br />

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

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

error in this case.<br />

See also<br />

• __usat on page 4-93<br />

• SSAT and USAT on page 4-96 in the Assembler <strong>Guide</strong>.<br />

4.7.39 __strex<br />

This intrinsic inserts an instruction of the form STREX{size} into the instruction stream<br />

generated by the compiler. It enables you to use a STREX instruction in your C or C++<br />

code to store data to memory.<br />

Syntax<br />

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

Where:<br />

val<br />

ptr<br />

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

Points to the address of the data to be written to in memory. To specify<br />

the size of the data to be written, cast the parameter to an appropriate<br />

integral type.<br />

Table 4-10 Access widths supported by the __strex intrinsic<br />

Instruction Size of data loaded C cast<br />

STREXB unsigned byte (char *)<br />

STREXH unsigned halfword (short int *)<br />

STREX word (int *)<br />

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

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!