## 3.7. Saturating instructions

Table 3.10 shows the saturating instructions:

Table 3.10. Saturating instructions

MnemonicBrief descriptionSee
`SSAT`Signed SaturateSSAT and USAT
`SSAT16`Signed Saturate HalfwordSSAT16 and USAT16
`USAT`Unsigned SaturateSSAT and USAT
`USAT16`Unsigned Saturate HalfwordSSAT16 and USAT16
`QADD`Saturating AddQADD and QSUB
`QSUB`Saturating SubtractQADD and QSUB
`QSUB16`Saturating Subtract 16QADD and QSUB
`QASX`Saturating Add and Subtract with ExchangeQASX and QSAX
`QSAX`Saturating Subtract and Add with ExchangeQASX and QSAX
`QDADD`Saturating Double and AddQDADD and QDSUB
`QDSUB`Saturating Double and SubtractQDADD and QDSUB
`UQADD16`Unsigned Saturating Add 16UQADD and UQSUB
`UQADD8`Unsigned Saturating Add 8UQADD and UQSUB
`UQASX`Unsigned Saturating Add and Subtract with ExchangeUQASX and UQSAX
`UQSAX`Unsigned Saturating Subtract and Add with ExchangeUQASX and UQSAX
`UQSUB16`Unsigned Saturating Subtract 16UQADD and UQSUB
`UQSUB8`Unsigned Saturating Subtract 8UQADD and UQSUB

For signed `n`-bit saturation, this means that:

• If the value to be saturated is less than −2`n−1`, the result returned is −2`n-1`

• If the value to be saturated is greater than 2`n−1`−1, the result returned is 2`n-1`−1

• Otherwise, the result returned is the same as the value to be saturated.

For unsigned `n`-bit saturation, this means that:

• If the value to be saturated is less than 0, the result returned is 0

• If the value to be saturated is greater than 2`n`−1, the result returned is 2`n`−1

• Otherwise, the result returned is the same as the value to be saturated.

If the returned result is different from the value to be saturated, it is called saturation. If saturation occurs, the instruction sets the Q flag to 1 in the APSR. Otherwise, it leaves the Q flag unchanged. To clear the Q flag to 0, you must use the `MSR` instruction, see MSR.

To read the state of the Q flag, use the `MRS` instruction, see MRS.