3.7. Saturating instructions

Table 3.10 shows the saturating instructions:

Table 3.10. Saturating instructions

MnemonicBrief descriptionSee
SSATSigned SaturateSSAT and USAT
SSAT16Signed Saturate HalfwordSSAT16 and USAT16
USATUnsigned SaturateSSAT and USAT
USAT16Unsigned Saturate HalfwordSSAT16 and USAT16
QADDSaturating AddQADD and QSUB
QSUBSaturating SubtractQADD and QSUB
QSUB16Saturating Subtract 16QADD and QSUB
QASXSaturating Add and Subtract with ExchangeQASX and QSAX
QSAXSaturating Subtract and Add with ExchangeQASX and QSAX
QDADDSaturating Double and AddQDADD and QDSUB
QDSUBSaturating Double and SubtractQDADD and QDSUB
UQADD16Unsigned Saturating Add 16UQADD and UQSUB
UQADD8Unsigned Saturating Add 8UQADD and UQSUB
UQASXUnsigned Saturating Add and Subtract with ExchangeUQASX and UQSAX
UQSAXUnsigned Saturating Subtract and Add with ExchangeUQASX and UQSAX
UQSUB16Unsigned Saturating Subtract 16UQADD and UQSUB
UQSUB8Unsigned Saturating Subtract 8UQADD and UQSUB

For signed n-bit saturation, this means that:

For unsigned n-bit saturation, this means that:

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.

Copyright © 2015, 2018 Arm. All rights reserved.ARM DUI 0646C