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

4.7.102 __usat16 intrinsic<br />

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

compiler. It enables you to saturate two signed 16-bit values to a selected unsigned<br />

range. The Q flag is set if either operation saturates.<br />

unsigned int __usat16(unsigned int val1, /* constant */ unsigned int val2)<br />

Where:<br />

val1<br />

val2<br />

holds the two 16-bit values that are to be saturated<br />

specifies the bit position for saturation, and must be an integral constant<br />

expression.<br />

The __usat16 intrinsic returns the saturation of the two signed 16-bit values, as<br />

non-negative values.<br />

Example:<br />

unsigned int saturate_halfwords(unsigned int val1, unsigned int val2)<br />

{<br />

unsigned int res;<br />

}<br />

res = __usax(val1,val2); /* Saturate halfwords in val1 to the unsigned<br />

range specified by the bit position in val2<br />

*/ return res;<br />

See also<br />

• <strong>ARM</strong>v6 SIMD intrinsics on page 4-109<br />

• Instruction summary on page 4-2 in the Assembler Guide<br />

• SSAT16 and USAT16 on page 4-104 in the Assembler Guide.<br />

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