-
Notifications
You must be signed in to change notification settings - Fork 38
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
Implement f{32,64}.sub instructions #474
Conversation
chfast
commented
Aug 12, 2020
•
edited by gumb0
Loading
edited by gumb0
EXPECT_THAT(exec(TypeParam{0.0}, q), Result(-q)); | ||
EXPECT_THAT(exec(-TypeParam{0.0}, -q), Result(q)); | ||
|
||
// Not part of the spec. |
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.
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.
The fsub(+-0, -q) = +-q
is missing.
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.
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.
You cannot resolve it like that because
they must be resolved consistently: either the upper sign is chosen for all of them or the lower sign.
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.
Oh I see. You mean only these are defined:
fsub(+0, +q2) = -q2
fsub(-0, -q2) = +q2
But not these
fsub(-0, +q2) = -q2
fsub(+0, -q2) = +q2
Probably a bug in the spec, because text description doesn't mention any special cases, just "if z1 is zero"
3cbf074
to
a01893e
Compare
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.
Looks good, needs typo fix and rebase
Codecov Report
@@ Coverage Diff @@
## master #474 +/- ##
========================================
Coverage 99.55% 99.56%
========================================
Files 54 54
Lines 16729 16858 +129
========================================
+ Hits 16655 16784 +129
Misses 74 74 |
Please approve. |
Checks the note from the Wasm spec: > Up to the non-determinism regarding NaNs, it always holds that > fsub(z1, z2) = fadd(z1, fneg(z2)).