← Home

vxrm

Vector Fixed-Point Rounding Mode

Address: 0x00A (10) · Privilege: U · Length: XLEN · Writable · Defined by: Zvl32b

Holds a 2-bit read-write rounding-mode field in the least-significant bits

Fields

RV32

31:2423:1615:87:0
VALUE

RV64

63:5655:4847:4039:3231:2423:1615:87:0
VALUE
BitsFieldAliasDescriptionTypeReset
RV32 [31:0]
RV64 [63:0]
VALUEThe vector fixed-point rounding-mode register holds a two-bit read-write rounding-mode field in the least-significant bits (vxrm[1:0]). The upper bits, vxrm[XLEN-1:2], should be written as zeros. The vector fixed-point rounding-mode is given a separate CSR address to allow independent access, but is also reflected as a field in vcsr. Note: A new rounding mode can be set while saving the original rounding mode using a single csrwi instruction. The fixed-point rounding algorithm is specified as follows. Suppose the pre-rounding result is v, and d bits of that result are to be rounded off. Then the rounded result is (v >> d) + r, where r depends on the rounding mode as specified in the following table of vxrm[1:0] values. ! vxrm[1:0] ! Abbreviation ! Rounding Mode ! Rounding increment, r ! 00 ! rnu ! round-to-nearest-up (add +0.5 LSB) ! v[d-1] ! 01 ! rne ! round-to-nearest-even ! v[d-1] & (v[d-2:0]\!=0 | v[d]) ! 10 ! rdn ! round-down (truncate) ! 0 ! 11 ! rod ! round-to-odd (OR bits into LSB, aka "jam") ! \!v[d] & v[d-1:0]\!=0RW-HUNDEFINED_LEGAL

Software read

return CSR[vcsr].VXRM;

Version af3eaf9+cheriot.f635218

Data from the RISC-V Unified Database, copyright RISC-V International and contributors.

CHERIoT extensions from the CHERIoT specification and Sail model, copyright Microsoft and the CHERIoT Platform contributors.

This site is provided as a community resource and is NOT affiliated with nor endorsed by RISC-V International.