Skip to content

Commit 8f4009e

Browse files
committed
Add a FutureFeatures.md section discussing full IEEE-754 conformance.
1 parent 950c551 commit 8f4009e

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

FutureFeatures.md

+25
Original file line numberDiff line numberDiff line change
@@ -300,3 +300,28 @@ tradeoffs.
300300
* float32.pow - exponentiate
301301

302302
The rounding behavior of these operations would need clarification.
303+
304+
## Full IEEE-754 conformance
305+
306+
IEEE-754 NaN bit pattern propagation is presently permitted but not required.
307+
It would be possible for WebAssembly to require it in the future.
308+
309+
To support exceptions and alternate rounding modes, one option is to define an
310+
alternate form for each of `add`, `sub`, `mul`, `div`, `sqrt`, and `FMA`. These
311+
alternate forms would have extra operands for rounding mode, masked traps, and
312+
old flags, and an extra result for a new flags value. These operations would be
313+
fairly verbose, but it's expected that their use cases will specialized. This
314+
approach has the advantage of exposing no global (even if only per-thread)
315+
control and status registers to applications, and to avoid giving the common
316+
operations the possibility of having side effects.
317+
318+
Debugging techniques are also important, but they don't necessarily need to be
319+
in the spec itself. Implementations are welcome (and encouraged) to support
320+
execution modes with alternate default rounding modes, or alternate execution
321+
modes which evaluate floating point expressions at greater precision, to support
322+
techniques used to detect numerical instability. Implementations are welcome to
323+
support execution modes where floating point exceptions trap by default,
324+
although this will be tricky because it may cause programs not written to
325+
anticipate this to fail spuriously. Implementations are welcome to produce quiet
326+
NaN values that contain identifiers helping programmers locate where the NaNs
327+
were first produced.

0 commit comments

Comments
 (0)