Skip to content

Canonicalize NaNs in the interpreter - #1046

Merged
binji merged 1 commit into
masterfrom
interp-nan
Mar 18, 2019
Merged

binji merged 1 commit into
masterfrom
interp-nan

Conversation

@binji

@binji binji commented Mar 18, 2019

Copy link
Copy Markdown
Member

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

binji commented Mar 18, 2019

Copy link
Copy Markdown
Member Author

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