|
| 1 | +# yaml-language-server: $schema=../../../schemas/csr_schema.json |
| 2 | + |
| 3 | +$schema: "csr_schema.json#" |
| 4 | +kind: csr |
| 5 | +name: frm |
| 6 | +long_name: Floating-Point Dynamic Rounding Mode |
| 7 | +address: 0x002 |
| 8 | +description: |
| 9 | + - id: csr-frm-encodings |
| 10 | + normative: false |
| 11 | + text: | |
| 12 | + Rounding modes are encoded as follows: |
| 13 | +
|
| 14 | + [[rm]] |
| 15 | + .Rounding mode encoding. |
| 16 | + [%autowidth,float="center",align="center",cols="^,^,<",options="header"] |
| 17 | + !=== |
| 18 | + !Rounding Mode |Mnemonic |Meaning |
| 19 | + !000 !RNE !Round to Nearest, ties to Even |
| 20 | + !001 !RTZ !Round towards Zero |
| 21 | + !010 !RDN !Round Down (towards latexmath:[$-\infty$]) |
| 22 | + !011 !RUP !Round Up (towards latexmath:[$+\infty$]) |
| 23 | + !100 !RMM !Round to Nearest, ties to Max Magnitude |
| 24 | + !101 ! !_Reserved for future use._ |
| 25 | + !110 ! !_Reserved for future use._ |
| 26 | + !111 !DYN !In instruction's _rm_ field, selects dynamic rounding mode; In Rounding Mode register, _reserved_. |
| 27 | + !=== |
| 28 | + - id: csr-frm-reserved |
| 29 | + normative: false |
| 30 | + text: | |
| 31 | + The behavior of floating-point instructions that depend on rounding mode when |
| 32 | + executed with a reserved rounding mode is _reserved_, including both static |
| 33 | + reserved rounding modes (101-110) and dynamic reserved rounding modes (101-111). |
| 34 | + - id: csr-frm-rmfield |
| 35 | + normative: false |
| 36 | + text: | |
| 37 | + Some instructions, including widening conversions, have the _rm_ field but are |
| 38 | + nevertheless mathematically unaffected by the rounding mode; software should set |
| 39 | + their _rm_ field to RNE (000) but implementations must treat the _rm_ field as |
| 40 | + usual (in particular, with regard to decoding legal vs. reserved encodings). |
| 41 | +
|
| 42 | +priv_mode: U |
| 43 | +length: 32 |
| 44 | +definedBy: F |
| 45 | +fields: |
| 46 | + ROUNDINGMODE: |
| 47 | + alias: fcsr.FRM |
| 48 | + location: 2-0 |
| 49 | + description: | |
| 50 | + Rounding mode data. |
| 51 | + type: RW-H |
| 52 | + reset_value: UNDEFINED_LEGAL |
| 53 | + sw_write(csr_value): | |
| 54 | + CSR[fcsr].FRM = csr_value.ROUNDINGMODE; |
| 55 | + return csr_value.ROUNDINGMODE; |
| 56 | +sw_read(): | |
| 57 | + return |
| 58 | + CSR[fcsr].FRM; |
0 commit comments