frm

Floating-Point Dynamic Rounding Mode

Rounding modes are encoded as follows:

Table 1. Rounding mode encoding.
!Rounding Mode Mnemonic Meaning !000 !RNE !Round to Nearest, ties to Even !001 !RTZ !Round towards Zero !010 !RDN !Round Down (towards ) !011 !RUP !Round Up (towards ) !100 !RMM !Round to Nearest, ties to Max Magnitude !101 ! !Reserved for future use. !110 ! !Reserved for future use. !111 !DYN !In instruction’s rm field, selects dynamic rounding mode; In Rounding Mode register, reserved.

The behavior of floating-point instructions that depend on rounding mode when executed with a reserved rounding mode is reserved, including both static reserved rounding modes (101-110) and dynamic reserved rounding modes (101-111).

Some instructions, including widening conversions, have the rm field but are nevertheless mathematically unaffected by the rounding mode; software should set their rm field to RNE (000) but implementations must treat the rm field as usual (in particular, with regard to decoding legal vs. reserved encodings).

Attributes

Requirement

F

Defining extensions

F

Single-precision floating-point

CSR Address

0x2

Length

32-bit

Privilege Mode

U

Format

frm format
Figure 1. frm format

Field Summary

Name Location Type Reset Value

frm.ROUNDINGMODE

2:0

RW-H

UNDEFINED_LEGAL

Fields

ROUNDINGMODE

Location

2:0

Description

Rounding mode data.

Type

RW-H

Reset value

UNDEFINED_LEGAL

Software write

This CSR may store a value that is different from what software attempts to write.

When a software write occurs (e.g., through csrrw), the following determines the written value:

ROUNDINGMODE = CSR[fcsr].FRM = csr_value.ROUNDINGMODE;
return csr_value.ROUNDINGMODE;

Software read

This CSR may return a value that is different from what is stored in hardware.

return CSR[fcsr].FRM;