146
11100B–ATARM–31-Jul-12
SAM4S Series [Preliminary]
Examples
SMUAD
R0, R4, R5
; Multiplies bottom halfword of R4 with the bottom
; halfword of R5, adds multiplication of top halfword
; of R4 with top halfword of R5, writes to R0
SMUADX
R3, R7, R4
; Multiplies bottom halfword of R7 with top halfword
; of R4, adds multiplication of top halfword of R7
; with bottom halfword of R4, writes to R3
SMUSD
R3, R6, R2
; Multiplies bottom halfword of R4 with bottom halfword
; of R6, subtracts multiplication of top halfword of
; R6 with top halfword of R3, writes to R3
SMUSDX
R4, R5, R3
; Multiplies bottom halfword of R5 with top halfword
; of R3, subtracts multiplication of top halfword of
; R5 with bottom halfword of R3, writes to R4.
11.6.6.10
SMUL and SMULW
Signed Multiply (halfwords) and Signed Multiply (word by halfword)
Syntax
op{XY}{cond} Rd,Rn, Rm
op{Y}{cond} Rd. Rn, Rm
For
SMULXY
only:
Operation
The
SMULBB
,
SMULTB
,
SMULBT
and
SMULTT
instructions interprets the values from
Rn
and
Rm
as four
signed 16-bit integers. These instructions:
• Multiplies the specified signed halfword, Top or Bottom, values from
Rn
and
Rm
.
• Writes the 32-bit result of the multiplication in
Rd.
The
SMULWT
and
SMULWB
instructions interprets the values from
Rn
as a 32-bit signed integer and
Rm
as two halfword 16-bit signed integers. These instructions:
op
is one of:
SMUL{
XY
}
Signed Multiply (halfwords)
X
and
Y
specify which halfword of the source registers
Rn
and
Rm
is used as the first and
second multiply operand.
If
X
is
B
, then the bottom halfword, bits [15:0] of
Rn
is used.
If
X
is
T
, then the top halfword, bits [31:16] of
Rn
is used.If
Y
is
B
, then the bottom
halfword, bits [15:0], of
Rm
is used.
If
Y
is
T
, then the top halfword, bits [31:16], of
Rm
is used.
SMULW{Y}
Signed Multiply (word by halfword)
Y specifies which halfword of the source register
Rm
is used as the second multiply
operand.
If
Y
is
B
, then the bottom halfword (bits [15:0]) of
Rm
is used.
If
Y
is
T
, then the top halfword (bits [31:16]) of
Rm
is used.
cond
is an optional condition code, see
Rd
is the destination register.
Rn, Rm
are registers holding the first and second operands.
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 ...