From e4265e63e57ed18f5ebc2c1f548d40401e01c235 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 15 Jun 2015 10:24:32 -0700 Subject: Add a FutureFeatures.md section discussing full IEEE-754 conformance. --- FutureFeatures.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'FutureFeatures.md') diff --git a/FutureFeatures.md b/FutureFeatures.md index beba95d..831bd87 100644 --- a/FutureFeatures.md +++ b/FutureFeatures.md @@ -301,3 +301,28 @@ tradeoffs. * `float32.pow`: exponentiate The rounding behavior of these operations would need clarification. + +## Full IEEE-754 conformance + +IEEE-754 NaN bit pattern propagation is presently permitted but not required. +It would be possible for WebAssembly to require it in the future. + +To support exceptions and alternate rounding modes, one option is to define an +alternate form for each of `add`, `sub`, `mul`, `div`, `sqrt`, and `fma`. These +alternate forms would have extra operands for rounding mode, masked traps, and +old flags, and an extra result for a new flags value. These operations would be +fairly verbose, but it's expected that their use cases will specialized. This +approach has the advantage of exposing no global (even if only per-thread) +control and status registers to applications, and to avoid giving the common +operations the possibility of having side effects. + +Debugging techniques are also important, but they don't necessarily need to be +in the spec itself. Implementations are welcome (and encouraged) to support +execution modes with alternate default rounding modes, or alternate execution +modes which evaluate floating point expressions at greater precision, to support +techniques used to detect numerical instability. Implementations are welcome to +support execution modes where floating point exceptions trap by default, +although this will be tricky because it may cause programs not written to +anticipate this to fail spuriously. Implementations are welcome to produce quiet +NaN values that contain identifiers helping programmers locate where the NaNs +were first produced. -- cgit v1.2.3 From 57e6145a74667df7ba7bf42f935c9368adc84538 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 15 Jun 2015 13:22:03 -0700 Subject: Clarify the status of alternate execution modes. And provide a link to background reading about numerical debugging techniques. --- FutureFeatures.md | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'FutureFeatures.md') diff --git a/FutureFeatures.md b/FutureFeatures.md index 831bd87..8820b4b 100644 --- a/FutureFeatures.md +++ b/FutureFeatures.md @@ -318,11 +318,15 @@ operations the possibility of having side effects. Debugging techniques are also important, but they don't necessarily need to be in the spec itself. Implementations are welcome (and encouraged) to support -execution modes with alternate default rounding modes, or alternate execution -modes which evaluate floating point expressions at greater precision, to support -techniques used to detect numerical instability. Implementations are welcome to -support execution modes where floating point exceptions trap by default, -although this will be tricky because it may cause programs not written to -anticipate this to fail spuriously. Implementations are welcome to produce quiet -NaN values that contain identifiers helping programmers locate where the NaNs -were first produced. +non-standard execution modes, enabled only from developer tools, such as modes +with alternate rounding, or evaluation of floating point expressions at greater +precision, to support [techniques for detecting numerical instability] +(http://www.cs.berkeley.edu/~wkahan/Mindless.pdf). + +To help developers find the sources of floating point exceptions, +implementations may wish to provide a mode where NaN values are produced with +payloads containing identifiers helping programmers locate where the NaNs first +appeared. Another option would be to offer another non-standard execution mode, +enabled only from developer tools, that would enable traps on selected floating +point exceptions, however care should be taken, since not all floating point +exceptions indicate bugs. -- cgit v1.2.3 From acc06249557b7478dc33fc52d4c32da107953991 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 16 Jun 2015 08:33:23 -0700 Subject: Add an introductory sentence to the IEEE-754 section. --- FutureFeatures.md | 3 +++ 1 file changed, 3 insertions(+) (limited to 'FutureFeatures.md') diff --git a/FutureFeatures.md b/FutureFeatures.md index 8820b4b..1a91a1a 100644 --- a/FutureFeatures.md +++ b/FutureFeatures.md @@ -304,6 +304,9 @@ The rounding behavior of these operations would need clarification. ## Full IEEE-754 conformance +WebAssembly floating point conforms IEEE-754 in most respects, but there are a +few areas that are [not yet covered](AstSemantics.md#floating-point-operations). + IEEE-754 NaN bit pattern propagation is presently permitted but not required. It would be possible for WebAssembly to require it in the future. -- cgit v1.2.3