Introduction to ARM

Multiply Instructions

32×32→32 Multiply Instructions

<operation>{cond}{S} Rd, Rm, Rs {, Rn}

<operation>

MUL multiply
Rd := Rm × Rs
MLA multiply with accumulate
Rd := Rn + (Rm × Rs)

The multiply instructions produce the same result for both signed and unsigned values.

Specifying the same register for Rm and Rs has UNPREDICTABLE results. UNPREDICTABLE means that the result of an instruction cannot be relied upon.

32×32→64 Multiply Instructions

<operation>{cond}{S} RdLo, RdHi, Rm, Rs

64-bit result output into two registers.

<operation>

UMULL unsigned multiply long
RdHi, RdLo := Rm × Rs
UMLAL unsigned multiply with accumlate long
RdHi, RdLo := RdHi,RdLo + (Rm × Rs)
SMULL signed multiply long
RdHi, RdLo := Rm × Rs
SMLAL signed multiply with accumlate long
RdHi, RdLo := RdHi,RdLo + (Rm × Rs)

Note that they have the same form, but they treat the sign bit differently.

Navigate