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

||foo|| PROC<br />

MOV r1, #0xff<br />

MOV r0, #0x20<br />

SWP r0, r0, [r1]<br />

BX lr<br />

ENDP<br />

See also<br />

• SWP and SWPB on page 4-40 in the Assembler Guide.<br />

4.7.40 __usat<br />

This intrinsic inserts a USAT instruction into the instruction stream generated by the<br />

compiler. It enables you to saturate an unsigned value from within your C or C++ code.<br />

Syntax<br />

int __usat(unsigned int val, unsigned int sat)<br />

Where:<br />

val<br />

sat<br />

Is the value to be saturated.<br />

Is the bit position to saturate to.<br />

usat must be in the range 0 to 31.<br />

Return value<br />

The __usat intrinsic returns val saturated to the unsigned range 0 ≤ x ≤ 2 sat–1 –1.<br />

Errors<br />

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

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

error in this case.<br />

See also<br />

• __ssat on page 4-100<br />

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

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