Skip to content
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

test_sse1 does not validate as asm.js. #3043

Closed
juj opened this issue Dec 6, 2014 · 5 comments
Closed

test_sse1 does not validate as asm.js. #3043

juj opened this issue Dec 6, 2014 · 5 comments
Labels

Comments

@juj
Copy link
Collaborator

juj commented Dec 6, 2014

Build the newly merged SSE1 completeness test with

emcc tests/test_sse1.cpp -o a.html -O2 -s PRECISE_F32=1

and run in current Nightly. It will produce a validation error

TypeError: asm.js type error: then/else branches of conditional must both produce int or double, current types are float32x4 and float32x4

If one builds with -g2 flag in addition to above, the error changes to the following:

TypeError: asm.js type error: dot access field must be a lane name (x, y, z, w) or signMask

where the offending line reads

if ((SIMD_float32x4(Math_fround(nan), Math_fround(1.0), Math_fround(0.0), Math_fround(-1.0)).signMaskPolyfill | 0) != 8) {
  _fwrite(2568, 74, 1, HEAP32[_stderr >> 2] | 0) | 0;
  HEAP32[2] = (HEAP32[2] | 0) + 1;
}
@juj juj added the SIMD label Dec 6, 2014
@sunfishcode
Copy link
Collaborator

I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1108870 about the first validation error.

@sunfishcode
Copy link
Collaborator

I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1108877 about a bug which is blocking the proper fix for the second validation error.

@bnjbvr
Copy link

bnjbvr commented Dec 11, 2014

Fwiw, bug 1108870 has been fixed, patch in bug 1108877 is r+'d and waits for @sunfishcode landing it.

@sunfishcode
Copy link
Collaborator

Bugs 1108870 and 1108877 have both landed.

@juj juj mentioned this issue Jun 20, 2015
@juj
Copy link
Collaborator Author

juj commented Sep 3, 2015

Validates correctly in current incoming.

@juj juj closed this as completed Sep 3, 2015
kripken added a commit that referenced this issue Aug 21, 2020
Change the default value of STACK_OVERFLOW_CHECK in builds with ASSERTIONS
from 2 to 1. This means that plain debug builds (-O0, which enables
ASSERTIONS) do not have the most expensive stack checks on by default. You
can still add them with -s STACK_OVERFLOW_CHECK=2.

The most expensive checks seem excessive to run by default. I don't think any
platform does them. However, there is slightly more risk in wasm since we don't
have memory protection to give a guarantee of a trap. But the default stack
protections can be enough to detect that in most cases.

(The default protection, 1, writes a cookie and asserts the cookie is not overwritten
at various times. The expensive checks modify the wasm to make every stack
allocation check the limit.)

See #3043, this removes some work we were doing by default after link, so it
makes the link stage simpler.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants