Skip to content

Commit

Permalink
Merge #883
Browse files Browse the repository at this point in the history
883: For floating point operations, allow inputs to be arbitrary, including SNaNs. r=nlewycky a=nlewycky

# Description
For floating point operations, allow inputs to be arbitrary, including SNaNs.

Instead of ensuring inputs are canonical NaNs on every operation, we tag outputs as pending such a canonicalization check, so that a sequence of computations can have a single canonicalization step at the end.

There's an extra wriggle for SIMD. The Wasm type system only indicates them as V128, so it's possible that we might do computations as F32x4Add, I8x16Add, F64x2Add in a row with no other computations in between. Since a canonicalization may change the bit patterns in a way that transforms one non-NaN to another non-NaN in the next subsequent instructions interpretation, most SIMD functions apply pending canonicalizations to their inputs, even the integer SIMD operations.

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Nick Lewycky <[email protected]>
Co-authored-by: nlewycky <[email protected]>
Co-authored-by: Syrus Akbary <[email protected]>
  • Loading branch information
3 people authored Oct 25, 2019
2 parents 03a5b1f + dae9949 commit 8653216
Show file tree
Hide file tree
Showing 3 changed files with 855 additions and 749 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## **[Unreleased]**

- [#883](https://github.com/wasmerio/wasmer/pull/883) Allow floating point operations to have arbitrary inputs, even including SNaNs.

## 0.9.0 - 2019-10-23

Special thanks to @alocquet for their contributions!
Expand Down
Loading

0 comments on commit 8653216

Please sign in to comment.