divw
riscv_unified_db)RV32 / RV64 (Ratified & Standard Extensions)
main
userMSummary
Divide the lower 32-bits of register xs1 by the lower 32-bits of register xs2, and store the sign-extended result in xd.
Syntax / Encoding
divw xd, xs1, xs2 | 0000001xxxxxxxxxx100xxxxx0111011 (mask=0xfe00707f match=0x0200403b)
Cross-Chip Latency & Throughput (10 cores)
| Microarchitecture | Latency (cycles) | Recip. TP | uops | Ports | Source |
|---|---|---|---|---|---|
| Andes 45-Series | 1 | 1 | 1 | Andes45MDU | llvm_sched_models |
| MIPS P8700 (RISC-V) | 1 | 1 | 1 | p8700GpDiv | llvm_sched_models |
| SpacemiT X100 | 1 | 0.5 | 1 | SMTX100_IQ0 | llvm_sched_models |
| SpacemiT X60 (K1) | 1 | 1 | 1 | SMX60_IEUA | llvm_sched_models |
| Tenstorrent Ascalon-X | 1 | 1 | 1 | AscalonFXA | llvm_sched_models |
| XiangShan KunMingHu | 1 | 1 | 1 | XSPipeBJU3 | llvm_sched_models |
| XiangShan NanHu | 1 | 0.5 | 1 | XS2MDU | llvm_sched_models |
| SiFive P670 / P600 | 20 | 19 | 2 | SiFiveP600MulI2F+SiFiveP600Div | llvm_sched_models |
| SiFive P870 / P800 | 20 | 19 | 2 | SiFiveP800IEXQ2+SiFiveP800Div | llvm_sched_models |
| SiFive 7-Series (U74) | 34 | 33 | 2 | PipeB+IDiv | llvm_sched_models |
Binary Encodings (1)
| Width | Format | Bit Pattern | Mask / Match |
|---|---|---|---|
| 32 | RV | 0000001xxxxxxxxxx100xxxxx0111011 | 0xfe00707f / 0x0200403b |
Operands
| Name | Description |
|---|---|
xs2 | bits [24:20] |
xs1 | bits [19:15] |
xd | bits [11:7] |
Reference Notes
Divide the lower 32-bits of register xs1 by the lower 32-bits of register xs2, and store the sign-extended result in xd. The remainder is discarded. Division by zero will put -1 into xd. Division resulting in signed overflow (when most negative number is divided by -1) will put the most negative number into xd;