@@ -300,3 +300,28 @@ tradeoffs.
300
300
* float32.pow - exponentiate
301
301
302
302
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