mulhsu
riscv_unified_db)RV32 / RV64 (Ratified & Standard Extensions)
main
userZmmul, Zkt-DITSummary
Multiply the signed value in xs1 by the unsigned value in xs2, and store the upper half of the result in xd. The lower half is thrown away.
Syntax / Encoding
mulhsu xd, xs1, xs2 | 0000001xxxxxxxxxx010xxxxx0110011 (mask=0xfe00707f match=0x02002033)
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 |
| Andes 45-Series | 3 | 1 | 1 | Andes45MDU | llvm_sched_models |
| SiFive 7-Series (U74) | 3 | 1 | 1 | PipeB | llvm_sched_models |
| SpacemiT X100 | 3 | 0.5 | 1 | SMTX100_IQ1 | 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 |
| SpacemiT X60 (K1) | 6 | 0.5 | 1 | SMX60_IEU | llvm_sched_models |
Binary Encodings (1)
| Width | Format | Bit Pattern | Mask / Match |
|---|---|---|---|
| 32 | RV | 0000001xxxxxxxxxx010xxxxx0110011 | 0xfe00707f / 0x02002033 |
Operands
| Name | Description |
|---|---|
xs2 | bits [24:20] |
xs1 | bits [19:15] |
xd | bits [11:7] |
Reference Notes
Multiply the signed value in xs1 by the unsigned value in xs2, and store the upper half of the result in xd. The lower half is thrown away. If both the upper and lower halves are needed, it suggested to use the sequence: --- mulhsu xdh, xs1, xs2 mul xdl, xs1, xs2 --- Microarchitectures may look for that sequence and fuse the operations.