This intrinsic inserts a USAT16 instruction into
the instruction stream generated by the compiler. It enables you
to saturate two signed 16-bit values to a selected unsigned range.
The Q flag is set if either operation saturates.
unsigned int __usat16(unsigned int val1, /* constant */ unsigned int val2)
where:
val1
holds the two 16-bit values that are to be saturated
val2
specifies the bit position for saturation, and must
be an integral constant expression.
The __usat16 intrinsic returns the saturation
of the two signed 16-bit values, as non-negative values.
Example:
unsigned int saturate_halfwords(unsigned int val1, unsigned int val2)
{
unsigned int res;
res = __usax(val1,val2); /* Saturate halfwords in val1 to the unsigned
range specified by the bit position in val2
*/ return res;
}
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.