mulw
riscv_unified_db)RV32 / RV64 (Ratified & Standard Extensions)
main
userZmmul, Zkt-DITSummary
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)
| Microarchitecture | Latency (cycles) | Recip. TP | uops | Ports | Source |
|---|---|---|---|---|---|
| SiFive P670 / P600 | 2 | 1 | 1 | SiFiveP600MulI2F | llvm_sched_models |
| SiFive P870 / P800 | 2 | 0.5 | 1 | SiFiveP800Mul | llvm_sched_models |
| SpacemiT X100 | 2 | 0.5 | 1 | SMTX100_IQ1 | llvm_sched_models |
| Andes 45-Series | 3 | 1 | 1 | Andes45MDU | llvm_sched_models |
| SiFive 7-Series (U74) | 3 | 1 | 1 | PipeB | llvm_sched_models |
| SpacemiT X60 (K1) | 3 | 0.5 | 1 | SMX60_IEU | llvm_sched_models |
| Tenstorrent Ascalon-X | 3 | 1 | 1 | AscalonFXA | llvm_sched_models |
| XiangShan KunMingHu | 3 | 0.5 | 1 | XSPipeGroupMUL | llvm_sched_models |
| XiangShan NanHu | 3 | 0.5 | 1 | XS2MDU | llvm_sched_models |
| MIPS P8700 (RISC-V) | 4 | 1 | 1 | p8700GpMul | llvm_sched_models |
Binary Encodings (1)
| Width | Format | Bit Pattern | Mask / Match |
|---|---|---|---|
| 32 | RV | 0000001xxxxxxxxxx000xxxxx0111011 | 0xfe00707f / 0x0200003b |
Operands
| Name | Description |
|---|---|
xs2 | bits [24:20] |
xs1 | bits [19:15] |
xd | bits [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].