MUL

Multiply

MUL rd, rs1, rs2

Performs a 32-bit (or 64-bit) multiplication of rs1 and rs2 and stores the lower bits in rd.

Details

MUL performs an XLEN-bit × XLEN-bit multiplication of rs1 and rs2 and writes the lower XLEN bits of the product to rd. Both operands are treated as signed or unsigned (the result is the same for the low bits).

Pseudocode Operation

R[rd] = (R[rs1] * R[rs2])[XLEN-1:0];

Example

MUL x10, x11, x12

Encoding

Binary Layout
0000001
31:25
rs2
24:20
rs1
19:15
000
14:12
rd
11:7
0110011
6:0
 
Format R-Type
Opcode 0x33
Extension M

Operands

  • rd
    Dest (Lower Bits)
  • rs1
    Source register 1 (integer)
  • rs2
    Source register 2 (integer)