-
Notifications
You must be signed in to change notification settings - Fork 478
More floating point tests! #282
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
Conversation
Ping :-). |
I skimmed the tests and things look good to me, although, most goes above my head ;) However, the binaryen interpreter fails in
I'm not sure I understand what is being tested there? |
Looks like the bug is this last line:
AstSemantics says:
So the requirement is to set 1 as the MSB of the fraction field, rest can be zero or the original value, and sign bit can be anything. The test seems over-constrained, but I also have a bug in binaryen. I'll fix :-) |
It's testing that a floating-point divide of a signaling NaN operand divided by an immediate zero returns a quiet NaN, per IEEE 754, and that the rest of the NaN payload and sign bit are propagated per wasm's rules, except that it's not yet updated for WebAssembly/design#660. I plan to update it when I update all the tests. |
@@ -1219,6 +1271,19 @@ | |||
|
|||
(assert_return (invoke "llvm_pr27153" (i32.const 33554434)) (f32.const 25165824.000000)) | |||
|
|||
;; Test that (float)x + (float)y is not optimzied to (float)(x + y) when unsafe. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optimized
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed; thanks!
As discussed in: WebAssembly/spec#282 (comment)
|
Can you clarify in what way it's over-constrained? |
As discussed in: WebAssembly/spec#282 (comment)
I'm not sure if I'm misunderstanding, but this seems to give leeway to implementations:
It sounds like the sign can be whatever, and the NaN can propagate to quiet (same payload, but not signaling) or be quiet NaN with zeroes as fraction. Is that correct? |
That's the new text in WebAssembly/design#660. Many existing tests also need to be updated as well. I plan to do all the updates at once. |
See discussion in WebAssembly/spec#282
Ah right, ty! /me unconfused |
High-level lgtm! |
Merging, with high-level lgtm, since these just add new tests with no spec changes. As always, these and all tests continue to be open to comments and questions. |
Sorry, I was away. Also LGTM |
This adds a bunch more tests focused on floating point.
Note that there are some minor inconsistencies in general with how NaNs are handled; I plan to address those separately as part of the work related to WebAssembly/design#660.