![Atmel SAM4S Series Preliminary Data Sheet Download Page 150](http://html1.mh-extra.com/html/atmel/sam4s-series/sam4s-series_preliminary-data-sheet_3003408150.webp)
150
11100B–ATARM–31-Jul-12
SAM4S Series [Preliminary]
11.6.7
Saturating Instructions
The table below shows the saturating instructions:
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 satura-
tion 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, the
MSR
instruction must be used; see
To read the state of the Q flag, the
MRS
Table 11-22. Saturating Instructions
Mnemonic
Description
SSAT
Signed Saturate
SSAT16
Signed Saturate Halfword
USAT
Unsigned Saturate
USAT16
Unsigned Saturate Halfword
QADD
Saturating Add
QSUB
Saturating Subtract
QSUB16
Saturating Subtract 16
QASX
Saturating Add and Subtract with Exchange
QSAX
Saturating Subtract and Add with Exchange
QDADD
Saturating Double and Add
QDSUB
Saturating Double and Subtract
UQADD16
Unsigned Saturating Add 16
UQADD8
Unsigned Saturating Add 8
UQASX
Unsigned Saturating Add and Subtract with Exchange
UQSAX
Unsigned Saturating Subtract and Add with Exchange
UQSUB16
Unsigned Saturating Subtract 16
UQSUB8
Unsigned Saturating Subtract 8
Summary of Contents for SAM4S Series
Page 44: ...44 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Page 412: ...412 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Page 1105: ...1105 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Page 1143: ...1143 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 4 64 lead LQFP Package Drawing ...
Page 1145: ...1145 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 5 64 lead QFN Package Drawing ...