Skip to content

Commit acaef60

Browse files
committed
move per-target NaN info into a table
1 parent 854ba7e commit acaef60

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

Diff for: core/src/primitive_docs.rs

+14-7
Original file line numberDiff line numberDiff line change
@@ -1250,13 +1250,8 @@ mod prim_f16 {}
12501250
/// possible with a signaling NaN (the all-0 significand encodes an infinity) so unchanged NaN
12511251
/// propagation cannot occur with some inputs.
12521252
/// - **Target-specific NaN**: The quiet bit is set and the payload is picked from a target-specific
1253-
/// set of "extra" possible NaN payloads. The set can depend on the input operand values. This set
1254-
/// is empty on x86, ARM, and RISC-V (32bit and 64bit), but can be non-empty on other
1255-
/// architectures. Targets where this set is non-empty should document this in a suitable
1256-
/// location, e.g. their platform support page. (For instance, on wasm, if any input NaN does not
1257-
/// have the preferred all-zero payload or any input NaN is an SNaN, then this set contains all
1258-
/// possible payloads; otherwise, it is empty. On SPARC, this set consists of the all-one
1259-
/// payload.)
1253+
/// set of "extra" possible NaN payloads. The set can depend on the input operand values.
1254+
/// See the table below for the concrete NaNs this set contains on various targets.
12601255
///
12611256
/// In particular, if all input NaNs are quiet (or if there are no input NaNs), then the output NaN
12621257
/// is definitely quiet. Signaling NaN outputs can only occur if they are provided as an input
@@ -1282,6 +1277,18 @@ mod prim_f16 {}
12821277
/// guarantee is made about which of the NaN bit patterns described above will be returned. The
12831278
/// result does not have to match what happens when executing the same code at runtime, and the
12841279
/// result can vary depending on factors such as compiler version and flags.
1280+
///
1281+
/// ### Target-specific "extra" NaN values
1282+
// FIXME: Is there a better place to put this?
1283+
///
1284+
/// | `target_arch` | Extra payloads possible on this platform |
1285+
/// |---------------|---------|
1286+
/// | `x86`, `x86_64`, `arm`, `aarch64`, `riscv32`, `riscv64` | None |
1287+
/// | `sparc`, `sparc64` | The all-one payload |
1288+
/// | `wasm32`, `wasm64` | If all input NaNs are quiet with all-zero payload: None.<br> Otherwise: all possible payloads. |
1289+
///
1290+
/// For targets not in this table, all payloads are possible.
1291+
12851292
#[stable(feature = "rust1", since = "1.0.0")]
12861293
mod prim_f32 {}
12871294

0 commit comments

Comments
 (0)