ARM Instruction Set - MULL,MLAL
ARM7TDMI Data Sheet
ARM DDI 0029E
4-25
O
4.8
Multiply Long and Multiply-Accumulate Long (MULL,MLAL)
The instruction is only executed if the condition is true. The various conditions are
defined in
·
Table 4-2: Condition code summary
on page 4-5. The instruction encoding
is shown in
·
Figure 4-13: Multiply long instructions
.
The multiply long instructions perform integer multiplication on two 32 bit operands
and produce 64 bit results. Signed and unsigned multiplication each with optional
accumulate give rise to four variations.
Figure 4-13: Multiply long instructions
The multiply forms (UMULL and SMULL) take two 32 bit numbers and multiply them
to produce a 64 bit result of the form RdHi,RdLo := Rm * Rs. The lower 32 bits of the
64 bit result are written to RdLo, the upper 32 bits of the result are written to RdHi.
The multiply-accumulate forms (UMLAL and SMLAL) take two 32 bit numbers, multiply
them and add a 64 bit number to produce a 64 bit result of the form RdHi,RdLo := Rm
* Rs + RdHi,RdLo. The lower 32 bits of the 64 bit number to add is read from RdLo.
The upper 32 bits of the 64 bit number to add is read from RdHi. The lower 32 bits of
the 64 bit result are written to RdLo. The upper 32 bits of the 64 bit result are written
to RdHi.
The UMULL and UMLAL instructions treat all of their operands as unsigned binary
numbers and write an unsigned 64 bit result. The SMULL and SMLAL instructions
treat all of their operands as two's-complement signed numbers and write a two's-
complement signed 64 bit result.
4.8.1 Operand restrictions
R15 must not be used as an operand or as a destination register.
RdHi, RdLo, and Rm must all specify different registers.
Cond
0 0 0 0 1 U A S
RdHi
RdLo
Rs
1
0 0
1
Rm
0
3
4
7
8
11
12
15
16
19
20
21
22
23
27
28
31
Operand registers
Source destination registers
Set condition code
0 = do not alter condition codes
1 = set condition codes
Accumulate
0 = multiply only
1 = multiply and accumulate
Unsigned
0 = unsigned
1 = signed
Condition Field