ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 1,823 microarchs · 16,083 chips · 105 sources
Arch:
Tier:

mul

T1 riscv alu insn
Signed multiply
SourceRISC-V Official Unified Database (riscv-unified-db) (riscv_unified_db)
Reliability TierT1 — Official Specification
ISA / Silicon ScopeRV32/RV64 Zmmul, Zkt-DIT
RV32 / RV64 (Ratified & Standard Extensions)
License & VersionApache-2.0 / CC-BY-4.0
main
Upstreamhttps://github.com/riscv/riscv-unified-db
Privilegeuser
ExtensionsZmmul, Zkt-DIT

Summary

MUL performs an XLEN-bitxXLEN-bit multiplication of xs1 by xs2 and places the lower XLEN bits in the destination register. Any overflow is thrown away.

Syntax / Encoding

mul xd, xs1, xs2 | 0000001xxxxxxxxxx000xxxxx0110011 (mask=0xfe00707f match=0x02000033)

Cross-Chip Latency & Throughput (20 cores)

MicroarchitectureLatency (cycles)Recip. TPuopsPortsSource
Andes AX45MPV—1.27—RVV 1.0, VLEN=512rvv_bench_timings
SiFive X280—1.65—RVV 1.0, VLEN=512 (Tenstorrent Blackhole)rvv_bench_timings
SpacemiT X100—1.5—RVV 1.0, VLEN=256rvv_bench_timings
SpacemiT X60—3.5—RVV 1.0, VLEN=256rvv_bench_timings
Tenstorrent Ascalon-X—1.5—RVV 1.0, VLEN=256rvv_bench_timings
XuanTie C906—4—RVV 0.7.1, VLEN=128 (Allwinner D1)rvv_bench_timings
XuanTie C908—2.5—RVV 1.0, VLEN=128 (Kendryte K230)rvv_bench_timings
XuanTie C910—1—RVV 0.7.1, VLEN=128 (TH1520)rvv_bench_timings
XuanTie C920 (SG2042)—1—RVV 0.7.1, VLEN=128 (Milk-V Pioneer)rvv_bench_timings
XuanTie C920v2—1.75—RVV 1.0, VLEN=128rvv_bench_timings
SiFive P670 / P600211SiFiveP600MulI2Fllvm_sched_models
SiFive P870 / P80020.51SiFiveP800Mulllvm_sched_models
Andes 45-Series311Andes45MDUllvm_sched_models
SiFive 7-Series (U74)311PipeBllvm_sched_models
SpacemiT X10030.51SMTX100_IQ1llvm_sched_models
Tenstorrent Ascalon-X311AscalonFXAllvm_sched_models
XiangShan KunMingHu30.51XSPipeGroupMULllvm_sched_models
XiangShan NanHu30.51XS2MDUllvm_sched_models
MIPS P8700 (RISC-V)411p8700GpMulllvm_sched_models
SpacemiT X60 (K1)60.51SMX60_IEUllvm_sched_models

Binary Encodings (1)

WidthFormatBit PatternMask / Match
32RV0000001xxxxxxxxxx000xxxxx01100110xfe00707f / 0x02000033

Operands

NameDescription
xs2bits [24:20]
xs1bits [19:15]
xdbits [11:7]

Reference Notes

MUL performs an XLEN-bitxXLEN-bit multiplication of `xs1` by `xs2` and places the lower
XLEN bits in the destination register.
Any overflow is thrown away.

[NOTE]
If both the high and low bits of the same product are required, then the recommended code
sequence is:
MULH[[S]U] xdh, xs1, xs2; MUL xdl, xs1, xs2
(source register specifiers must be in same order and xdh cannot be the same as xs1 or xs2).
Microarchitectures can then fuse these into a single multiply operation instead of
performing two separate multiplies.