4.7.38. __ssat

This intrinsic inserts an SSAT instruction into the instruction stream generated by the compiler. It enables you to saturate a signed value from within your C or C++ code.

Syntax

int __ssat(int val, unsigned int sat)

Where:

val

Is the value to be saturated.

sat

Is the bit position to saturate to.

sat must be in the range 1 to 32.

Return value

The __ssat intrinsic returns val saturated to the signed range -2sat-1 ≤ x ≤ 2sat-1 -1.

Errors

The compiler does not recognize the __ssat intrinsic when compiling for a target that does not support the SSAT instruction. The compiler generates either a warning or an error in this case.

See also

Copyright © 2007, 2010 ARM Limited. All rights reserved.ARM DUI 0348A
Non-Confidential