mul
lyszt.net covers mul and other RISC-V instructions in more detail.
Encoding format
Description
Multiplies the values of two registers and stores the low 32 bits of the product. In mul rd, rs1, rs2, the values in rs1 and rs2 are multiplied and the result goes to rd. A product of two 32-bit numbers can need up to 64 bits, and mul returns only the lower half, with mulh supplying the upper. Signed and unsigned inputs produce the same lower 32 bits, and a processor can fuse mulh plus mul on the same sources into one multiplication.
Official definition
MUL performs an XLEN-bit×XLEN-bit multiplication of rs1 by rs2 and places the lower XLEN bits in the destination register. MULH, MULHU, and MULHSU perform the same multiplication but return the upper XLEN bits of the full 2×XLEN-bit product, for signed×signed, unsigned×unsigned, and rs1×unsigned rs2 multiplication. If both the high and low bits of the same product are required, then the recommended code sequence is: MULH[[S]U] rdh, rs1, rs2; MUL rdl, rs1, rs2 (source register specifiers must be in same order and rdh cannot be the same as rs1 or rs2). Microarchitectures can then fuse these into a single multiply operation instead of performing two separate multiplies.