157
11100B–ATARM–31-Jul-12
SAM4S Series [Preliminary]
Examples
UQASX
R7, R4, R2
; Adds top halfword of R4 with bottom halfword of R2,
; saturates to 16 bits, writes to top halfword of R7
; Subtracts top halfword of R2 from bottom halfword of R4
; saturates to 16 bits, writes to bottom halfword of R7
UQSAX
R0, R3, R5
; Subtracts bottom halfword of R5 from top halfword of R3
; saturates to 16 bits, writes to top halfword of R0
; Adds bottom halfword of R4 to top halfword of R5
; saturates to 16 bits, writes to bottom halfword of R0.
11.6.7.7
UQADD and UQSUB
Saturating Add and Saturating Subtract Unsigned.
Syntax
op{cond} {Rd}, Rn, Rm
op{cond} {Rd}, Rn, Rm
where:
Operation
These instructions add or subtract two or four values and then writes an unsigned saturated
value in the destination register.
The
UQADD16
instruction:
• Adds the respective top and bottom halfwords of the first and second operands.
• Saturates the result of the additions for each halfword in the destination register to the
unsigned range 0 £ x £ 2
16
-1, where x is 16.
The
UQADD8
instruction:
• Adds each respective byte of the first and second operands.
• Saturates the result of the addition for each byte in the destination register to the unsigned
range 0 £ x £ 2
8
-1, where x is 8.
The
UQSUB16
instruction:
• Subtracts both halfwords of the second operand from the respective halfwords of the first
operand.
• Saturates the result of the differences in the destination register to the unsigned range
0 £ x £ 2
16
-1, where x is 16.
The
UQSUB8
instructions:
op
is one of:
UQADD8
Saturating four unsigned 8-bit integer additions.
UQADD16
Saturating two unsigned 16-bit integer additions.
UDSUB8
Saturating four unsigned 8-bit integer subtractions.
UQSUB16
Saturating two unsigned 16-bit integer subtractions.
cond
is an optional condition code, see
Rd
is the destination register.
Rn, Rm
are registers holding the first and second operands.
Содержание SAM4S Series
Страница 44: ...44 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Страница 412: ...412 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Страница 1105: ...1105 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Страница 1142: ...1142 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 3 100 ball VFBGA Package Drawing ...
Страница 1143: ...1143 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 4 64 lead LQFP Package Drawing ...
Страница 1145: ...1145 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 5 64 lead QFN Package Drawing ...