ARM > Introduction to ARM > Multiply Instructions

by David Thomas on

32×32→32 Multiply Instructions

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

<operation>

  • MULMultiply
    • Rd := Rm × Rs
  • MLAMultiply with Accumulate
    • Rd := Rn + (Rm × Rs)

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

Historical note: Prior to ARMv4 specifying the same register for Rd and Rm had potentially unpredictable results.

32×32→64 Multiply Instructions

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

64-bit result output into two registers.

<operation>

  • UMULLUnsigned Multiply Long
    • RdHi, RdLo := Rm × Rs
  • UMLALUnsigned Multiply with Accumlate Long
    • RdHi, RdLo := RdHi,RdLo + (Rm × Rs)
  • SMULLSigned Multiply Long
    • RdHi, RdLo := Rm × Rs
  • SMLALSigned Multiply with Accumlate Long
    • RdHi, RdLo := RdHi,RdLo + (Rm × Rs)

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