![Atmel SAM4S Series Preliminary Data Sheet Download Page 142](http://html1.mh-extra.com/html/atmel/sam4s-series/sam4s-series_preliminary-data-sheet_3003408142.webp)
142
11100B–ATARM–31-Jul-12
SAM4S Series [Preliminary]
Operation
The
SMLSD
instruction interprets the values from the first and second operands as four signed
halfwords. This instruction:
• Optionally rotates the halfwords of the second operand.
• Performs two signed 16 × 16-bit halfword multiplications.
• Subtracts the result of the upper halfword multiplication from the result of the lower halfword
multiplication.
• Adds the signed accumulate value to the result of the subtraction.
• Writes the result of the addition to the destination register.
The
SMLSLD
instruction interprets the values from
Rn
and
Rm
as four signed halfwords.
This instruction:
• Optionally rotates the halfwords of the second operand.
• Performs two signed 16 × 16-bit halfword multiplications.
• Subtracts the result of the upper halfword multiplication from the result of the lower halfword
multiplication.
• Adds the 64-bit value in
RdHi
and
RdLo
to the result of the subtraction.
• Writes the 64-bit result of the addition to the
RdHi
and
RdLo
.
Restrictions
In these instructions:
• Do not use SP and do not use PC.
Condition Flags
This instruction sets the Q flag if the accumulate operation overflows. Overflow cannot occur
during the multiplications or subtraction.
For the Thumb instruction set, these instructions do not affect the condition code flags.
Examples
SMLSD
R0, R4, R5, R6
; Multiplies bottom halfword of R4 with bottom
; halfword of R5, multiplies top halfword of R4
; with top halfword of R5, subtracts second from
; first, adds R6, writes to R0
SMLSDX
R1, R3, R2, R0
; Multiplies bottom halfword of R3 with top
; halfword of R2, multiplies top halfword of R3
; with bottom halfword of R2, subtracts second
; from first, adds R0, writes to R1
SMLSLD
R3, R6, R2, R7
; Multiplies bottom halfword of R6 with bottom
; halfword of R2, multiplies top halfword of R6
; with top halfword of R2, subtracts second from
; first, adds R6:R3, writes to R6:R3
SMLSLDX
R3, R6, R2, R7
; Multiplies bottom halfword of R6 with top
; halfword of R2, multiplies top halfword of R6
; with bottom halfword of R2, subtracts second
; from first, adds R6:R3, writes to R6:R3.
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 ...