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

mulw

T1 riscv alu insn
Signed 32-bit 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

Multiplies the lower 32 bits of the source registers, placing the sign-extension of the lower 32 bits of the result into the destination register.

Syntax / Encoding

mulw xd, xs1, xs2 | 0000001xxxxxxxxxx000xxxxx0111011 (mask=0xfe00707f match=0x0200003b)

Cross-Chip Latency & Throughput (10 cores)

MicroarchitectureLatency (cycles)Recip. TPuopsPortsSource
SiFive P670 / P600211SiFiveP600MulI2Fllvm_sched_models
SiFive P870 / P80020.51SiFiveP800Mulllvm_sched_models
SpacemiT X10020.51SMTX100_IQ1llvm_sched_models
Andes 45-Series311Andes45MDUllvm_sched_models
SiFive 7-Series (U74)311PipeBllvm_sched_models
SpacemiT X60 (K1)30.51SMX60_IEUllvm_sched_models
Tenstorrent Ascalon-X311AscalonFXAllvm_sched_models
XiangShan KunMingHu30.51XSPipeGroupMULllvm_sched_models
XiangShan NanHu30.51XS2MDUllvm_sched_models
MIPS P8700 (RISC-V)411p8700GpMulllvm_sched_models

Binary Encodings (1)

WidthFormatBit PatternMask / Match
32RV0000001xxxxxxxxxx000xxxxx01110110xfe00707f / 0x0200003b

Operands

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

Reference Notes

Multiplies the lower 32 bits of the source registers, placing the sign-extension of the
lower 32 bits of the result into the destination register.

Any overflow is thrown away.

[NOTE]
In RV64, MUL can be used to obtain the upper 32 bits of the 64-bit product,
but signed arguments must be proper 32-bit signed values, whereas unsigned arguments
must have their upper 32 bits clear. If the arguments are not known to be sign- or zero-extended,
an alternative is to shift both arguments left by 32 bits, then use MULH[[S]U].