You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: text/0000-float-semantics.md
+4-6Lines changed: 4 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -64,16 +64,14 @@ A floating-point NaN value consists of a sign bit, a quiet/signaling bit, and a
64
64
For the operations listed above, the following rules apply when a NaN value is returned:
65
65
the result has a non-deterministic sign; the quiet bit and payload are non-deterministically chosen from the following set of options:
66
66
67
-
- The quiet bit is set and the payload is all-zero. ("Preferred NaN" case)
68
-
- The quiet bit is set and the payload is copied from any input operand that is a NaN.
69
-
("Quieting NaN propagation" case) <br>
67
+
-**Preferred NaN**: The quiet bit is set and the payload is all-zero.
68
+
-**Quieting NaN propagation**: The quiet bit is set and the payload is copied from any input operand that is a NaN.
70
69
If the inputs and outputs do not have the same payload size (i.e., for `as` casts), then
71
70
- If the output is smaller than the input, low-order bits of the payload get dropped.
72
71
- If the output is larger than the input, the payload gets filled up with 0s in the low-order bits.
73
-
- The quiet bit and payload are copied from any input operand that is a NaN.
74
-
("Unchanged NaN propagation" case) <br>
72
+
-**Unchanged NaN propagation**: The quiet bit and payload are copied from any input operand that is a NaN.
75
73
If the inputs and outputs do not have the same size (i.e., for `as` casts), the same rules as for "quieting NaN propagation" apply, with one caveat: if the output is smaller than the input, droppig the low-order bits may result in a payload of 0; a payload of 0 is not possible with a signaling NaN (the all-0 significand encodes an infinity) so unchanged NaN propagation cannot occur with some inputs.
76
-
- The quiet bit is set and the payload is picked from a target-specific set of
74
+
-**Target-specific NaN**: The quiet bit is set and the payload is picked from a target-specific set of
77
75
"extra" possible NaN payloads. The set can depend on the input operand values.
78
76
This set is empty on x86, ARM, and RISC-V (32bit and 64bit), but can be non-empty on other architectures. Targets where this set is non-empty should document this in a suitable location, e.g. their platform support page.
79
77
(For instance, on wasm, if any input NaN does not have the preferred all-zero payload or any input NaN is an SNaN, then this set contains all possible payloads; otherwise, it is empty. On SPARC, this set consists of the all-one payload.)
0 commit comments