Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canonicalize NaNs in the interpreter #1046

Merged
merged 1 commit into from
Mar 18, 2019
Merged

Canonicalize NaNs in the interpreter #1046

merged 1 commit into from
Mar 18, 2019

Conversation

binji
Copy link
Member

@binji binji commented Mar 18, 2019

Even though we store f32 and f64 values as their representation, we
still use the underlying system's implementations for float operations.
These have non-deterministic behavior w.r.t. NaNs.

This change canoncalizes all NaNs where it is allowed. This excludes
fxx.abs, fxx.neg, fxx.copysign and fxx.reinterpret*, which
always work on the floating-point representation directly, and the
fxx.convert* instructions, which cannot be NaN because the input is an
integer.

Even though we store f32 and f64 values as their representation, we
still use the underlying system's implementations for float operations.
These have non-deterministic behavior w.r.t. NaNs.

This change canoncalizes all NaNs where it is allowed. This excludes
`fxx.abs`, `fxx.neg`, `fxx.copysign` and `fxx.reinterpret*`, which
always work on the floating-point representation directly, and the
`fxx.convert*` instructions, which cannot be NaN because the input is an
integer.
@binji
Copy link
Member Author

binji commented Mar 18, 2019

This should fix some issues in #1043 and #1045. The wasm2c failures still need to be addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant