Webcentive RISC-V Reference

M instructions

Integer multiply and divide

This chapter describes the standard integer multiplication and division instruction extension, which is named M and contains instructions that multiply or divide values held in two integer registers.

Tip

We separate integer multiply and divide out from the base to simplify low-end implementations, or for applications where integer multiply and divide operations are either infrequent or better handled in attached accelerators.

Extension description from riscv-unified-db, reformatted.

Specification chapter: The RISC-V Instruction Set Manual, src/unpriv/m-st-ext.adoc.

Instructions (13)

MnemonicName (riscv-unified-db)XLEN
divSigned divisionRV32 and RV64
divuUnsigned divisionRV32 and RV64
divuwUnsigned 32-bit divisionRV64 only
divwSigned 32-bit divisionRV64 only
mulSigned multiplyRV32 and RV64
mulhSigned multiply highRV32 and RV64
mulhsuSigned/unsigned multiply highRV32 and RV64
mulhuUnsigned multiply highRV32 and RV64
mulwSigned 32-bit multiplyRV64 only
remSigned remainderRV32 and RV64
remuUnsigned remainderRV32 and RV64
remuwUnsigned 32-bit remainderRV64 only
remwSigned 32-bit remainderRV64 only