9.140 __usat intrinsic

This intrinsic inserts a USAT instruction into the instruction stream generated by the compiler.

It enables you to saturate an unsigned value from within your C or C++ code.


int __usat(unsigned int val, unsigned int sat)
Is the value to be saturated.
Is the bit position to saturate to.
usat must be in the range 0 to 31.

Return value

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


The compiler does not recognize the __usat intrinsic when compiling for a target that does not support the USAT instruction. The compiler generates either a warning or an error in this case, depending on the source language:
  • In C code: Warning: #223-D: function "__usat" declared implicitly.
  • In C++ code: Error: #20: identifier "__usat" is undefined.
Related reference
9.135 __ssat intrinsic
Related information
Non-ConfidentialPDF file icon PDF versionARM DUI0375F
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.