Instruction Set - MUL, MLA
ARM610 Data Sheet
4-22
O
4.6
Multiply and Multiply-Accumulate (MUL, MLA)
The instruction is only executed if the condition is true. The various conditions are
defined in
·
Table 4-2: Condition code summaryon page 4-6. The instruction encoding
is shown in
·
Figure 4-11: Multiply instructions
The multiply and multiply-accumulate instructions use an 8-bit Booth's algorithm to
perform integer multiplication.
Figure 4-11: Multiply instructions
The multiply form of the instruction gives Rd:=Rm*Rs. Rn is ignored, and should be
set to zero for compatibility with possible future upgrades to the instruction set.
The multiply-accumulate form gives Rd:=Rm*Rs+Rn, which can save an explicit ADD
instruction in some circumstances.
Both forms of the instruction work on operands which may be considered as signed
(two’s complement) or unsigned integers.
The results of a signed multiply and of an unsigned multiply of 32-bit operands differ
only in the upper 32 bits - the low 32 bits of the signed and unsigned results are
identical. As these instructions only produce the low 32 bits of a multiply, they can be
used for both signed and unsigned multiplies.
For example consider the multiplication of the operands:
Operand A
Operand B
Result
0xFFFFFFF6
0x0000001
0xFFFFFF38
If the operands are interpreted as signed
Operand A has the value -10, operand B has the value 20, and the result is -200 which
is correctly represented as 0xFFFFFF38
If the operands are interpreted as unsigned
Operand A has the value 4294967286, operand B has the value 20 and the result is
85899345720, which is represented as 0x13FFFFFF38, so the least significant 32 bits
are 0xFFFFFF38.
31
28 27
22
21
20 19
16 15
12 11
8
7
4
3
0
Cond
0
0
0
0
0
0
A
S
Rd
Rn
Rs
1
0
0
1
Rm
Operand registers
Destination register
Set condition code
0 = do not alter condition codes
1 = set condition codes
Accumulate
0 = multiply only
1 = multiply and accumulate
Condition Field