vxrm
Fixed-point rounding mode
- Address
0x00A- Group
- Unprivileged and user-level CSRs
- Privilege
URW(privileged spec CSR listing, Unprivileged Vector CSRs)- Access
- read/write; lowest privilege U (user/unprivileged)
- Address range
- Standard read/write
- Name in riscv-unified-db
- Vector Fixed-Point Rounding Mode
Privileged spec: Fixed-point rounding mode
Description
Holds a 2-bit read-write rounding-mode field in the least-significant bits
From riscv-unified-db, reformatted.
Fields
| Field | Bits | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
VALUE | RV32 31-0 / RV64 63-0 | RW-H | The 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.
|
Fields from riscv-unified-db; field types computed by IDL functions there are not shown.
Specification and related pages
- The RISC-V Instruction Set Manual, Volume II: CSR listing (src/priv/csrs.adoc)
- riscv-opcodes csrs.csv
- riscv-unified-db: spec/std/isa/csr/V/vxrm.yaml
- csrrw, csrrs, csrrc (Zicsr instructions that access CSRs)