-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Wasm: codegen for trunc and nearest with more tests #1316
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
|
Hi @commonlisp, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! The agreement was validated by Microsoft and real humans are currently evaluating your PR. TTYL, MSBOT; |
lib/Backend/LowerMDShared.cpp
Outdated
| #endif //ENABLE_WASM | ||
| { | ||
| roundMode = IR::IntConstOpnd::New(0x03, TyInt32, this->m_func); | ||
| if (isNotCeil) |
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.
this is a bit confusing now. i think would be more clear what is going on if we have switch on m_opcode (and i'm pretty sure || instr->m_opcode != Js::OpCode::InlineMathFloor will always be false)
3813b08 to
7ba4a7f
Compare
lib/Backend/LowerMDShared.cpp
Outdated
| } | ||
| else | ||
| { | ||
| roundMode = IR::IntConstOpnd::New(0x03, TyInt32, this->m_func); |
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.
was this block dead before?
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.
As far as I can tell. InlineMathRound and InlineMathFloor (i.e., != InlineMathCeil) are both handled by the first if-clause. Thus, the only remaining case is InlineMathCeil for which != InlineMathFloor always evaluates to true.
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.
I double checked and this is correct. The last block was never used.
|
Reviewed 6 of 7 files at r1, 1 of 1 files at r2. lib/Backend/Lower.cpp, line 2989 [r2] (raw file):
This requires SSE 4, it will crash or produce invalid code if the machine doesn't have sse 4. lib/Backend/LowerMDShared.cpp, line 6136 [r2] (raw file):
Also remove the declaration of both functions in the header file test/wasm/misc.wast, line 6 [r2] (raw file):
Add f64 tests for trunc and nearest. Also use named functions to avoid potential errors with the index when exporting Comments from Reviewable |
|
lib/Backend/Lower.cpp, line 2989 [r2] (raw file):
|
|
Review status: all files reviewed at latest revision, 3 unresolved discussions. lib/Backend/Lower.cpp, line 2989 [r2] (raw file):
|
|
Reviewed 9 of 9 files at r3. Comments from Reviewable |
…re tests Merge pull request #1316 from commonlisp:wasm_floatops_cg Added trunc and nearest codegen
This change is