Skip to content

Conversation

@kripken
Copy link
Member

@kripken kripken commented Sep 2, 2020

Similar to #2958, but for multiplication. I thought this was limited
only to division (it doesn't happen for addition, for example), but the
fuzzer found that it does indeed happen for multiplication as well.

Overall these are kind of workarounds for the interpreter doing
normal f32/f64 multiplications using the host CPU, so we pick up
any oddness of its NaN behavior. Using soft float might be safer
(but much slower).

@kripken kripken requested review from aheejin and tlively September 8, 2020 18:28
@kripken kripken merged commit 41ea543 into master Sep 9, 2020
@kripken kripken deleted the fuzz branch September 9, 2020 16:56
kripken added a commit that referenced this pull request Sep 30, 2020
Similar to clang and gcc, --fast-math makes us ignore corner cases of floating-point
math like NaN changes and (not done yet) lack of associativity and so forth.

In the future we may want to have separate fast math flags for each specific thing,
like gcc and clang do.

This undoes some changes (#2958 and #3096) where we assumed it was
ok to not change NaN bits, but @binji corrected us. We can only do such things in fast
math mode. This puts those optimizations behind that flag, adds tests for it, and
restores the interpreter to the simpler code from before with no special cases.
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.

3 participants