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.78 __ssat16 intrinsic<br />

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

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

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

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

Where:<br />

val1<br />

val2<br />

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

is the bit position for saturation, an integral constant expression in the<br />

range 1 to 16.<br />

The __ssat16 intrinsic returns:<br />

• the signed saturation of the low halfword in val1, saturated to the bit position<br />

specified in val2 and returned in the low halfword of the return value<br />

• the signed saturation of the high halfword in val1, saturated to the bit position<br />

specified in val2 and returned in the high halfword of the return value.<br />

Example:<br />

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

{<br />

unsigned int res;<br />

}<br />

res = __ssat16(val1,val2); /* Saturate halfwords in val1 to the signed<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 />

• Saturating instructions on page 4-93 in the Assembler Guide<br />

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

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