| |||
| Home > ARM and Thumb Instructions > Multiply instructions > MUL, MLA, and MLS | |||
Multiply, Multiply-Accumulate, and Multiply-Subtract, with signed or unsigned 32-bit operands, giving the least significant 32 bits of the result.
MUL{S}{cond}Rd,Rm,Rs
MLA{S}{cond}Rd,Rm,Rs,Rn
MLS{cond} Rd, Rm, Rs, Rn
where:
condis an optional condition code (see Conditional execution).
Sis
an optional suffix. If S is specified, the
condition code flags are updated on the result of the operation
(see Conditional execution).
You cannot use S in a Thumb-2 MLA instruction.
You can only use S in a Thumb-2 MUL instruction
if and Rd are
the same register, and all operands are low registers. This is a
16-bit instruction.Rm
Rdis the destination register.
Rm, Rsare registers holding the values to be multiplied.
Rnis a register holding the value to be added or subtracted from.
The MUL instruction multiplies the values from and Rm,
and places the least significant 32 bits of the result in Rs.Rd
The MLA instruction multiplies the values from and Rm,
adds the value from Rs,
and places the least significant 32 bits of the result in Rn.Rd
The MLS instruction multiplies the values from and Rm,
subtracts the result from the value from Rs,
and places the least significant 32 bits of the final result in Rn.Rd
Do not use r15 for , Rd, Rm,
or Rs.Rn
If S is specified, the MUL and MLA instructions:
update the N and Z flags according to the result
corrupt the C and V flag in ARMv4 and earlier
do not affect the C or V flag in ARMv5 and above.
The following form of the MUL instruction is
available in Thumb code, and is a 16-bit instruction when used in
Thumb-2 code:
MULS Rd, Rs, Rd and Rd must
both be Lo registers.Rs
The MUL and MLA ARM instructions
are available in all versions of the ARM architecture.
The MLS ARM instruction is available in ARMv6T2,
and ARMv7.
These Thumb-2 instructions are available in T2 variants of ARMv6 and above.
The MULS Thumb instruction is available in all
T variants of the ARM architecture.