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

rem

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

Summary

Calculate the remainder of signed division of xs1 by xs2, and store the result in xd.

Syntax / Encoding

rem xd, xs1, xs2 | 0000001xxxxxxxxxx110xxxxx0110011 (mask=0xfe00707f match=0x02006033)

Cross-Chip Latency & Throughput (9 cores)

MicroarchitectureLatency (cycles)Recip. TPuopsPortsSource
Andes 45-Series111Andes45MDUllvm_sched_models
MIPS P8700 (RISC-V)111p8700GpDivllvm_sched_models
SpacemiT X10010.51SMTX100_IQ0llvm_sched_models
SpacemiT X60 (K1)111SMX60_IEUAllvm_sched_models
Tenstorrent Ascalon-X111AscalonFXAllvm_sched_models
XiangShan KunMingHu111XSPipeBJU3llvm_sched_models
XiangShan NanHu10.51XS2MDUllvm_sched_models
SiFive P670 / P60035342SiFiveP600MulI2F+SiFiveP600Divllvm_sched_models
SiFive P870 / P80035342SiFiveP800IEXQ2+SiFiveP800Divllvm_sched_models

Binary Encodings (1)

WidthFormatBit PatternMask / Match
32RV0000001xxxxxxxxxx110xxxxx01100110xfe00707f / 0x02006033

Operands

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

Reference Notes

Calculate the remainder of signed division of xs1 by xs2, and store the result in xd.

If the value in register xs2 is zero, write the value in xs1 into xd;

If the result of the division overflows, write zero into xd;