CSR Bit Fields

RISC-V vxrm CSR Register

Address 0x00APrivilege User/VectorAccess RW / XLENUser vector state CSRs

vxrm is an XLEN-bit read-write CSR whose least-significant two bits select the vector fixed-point rounding mode.

Field Map

Understand vxrm By Bit Fields

2 key fields
XLEN-1:2

Reserved

Write zero

Reserved bits; should be written as zeros.

Reserved (bits XLEN-1:2) — Reserved bits; should be written as zeros.

What This Field Controls

  • - Reserved bits; should be written as zeros.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

Open Official Manual
1:0

VXRM

RW

Vector fixed-point rounding mode; mirrored in vcsr bits 2:1.

VXRM (bits 1:0) — Vector fixed-point rounding mode; mirrored in vcsr bits 2:1.

What This Field Controls

  • - Vector fixed-point rounding mode; mirrored in vcsr bits 2:1.

Common Values

0RNU

Round to nearest up (add 0.5 LSB).

1RNE

Round to nearest even.

2RDN

Round down; the rounding increment is zero.

3ROD

Round to odd; OR discarded bits into the least-significant bit (jam).

Open Official Manual
Official Basis & Search Notes

vxrm[1:0] selects the vector fixed-point rounding mode.

vxrm has one two-bit read-write rounding-mode field; its other bits should be written as zero.
The field is mirrored in vcsr bits 2:1.

What To Check First When Reading This CSR

  • - Accessing a vector CSR raises an illegal-instruction exception when mstatus.VS is Off.
  • - vxrm can have an arbitrary value at reset; software should explicitly reset the vxrm field before use.

Risk Checks Before Writing

  • - vxrm[XLEN-1:2] should be written as zeros.
  • - The rounding mode can also be accessed through its mirrored vcsr field.

Put It Back Into A Real Flow

1

Before vector fixed-point rounding is used, software explicitly sets vxrm[1:0].

2

Fixed-point instructions calculate their rounding increment according to the selected encoding.

FAQ

What are vxrm’s four encodings?

vxrm is an XLEN-bit read-write CSR whose least-significant two bits select the vector fixed-point rounding mode.