-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
SSE2 emmintrin.h #3542
SSE2 emmintrin.h #3542
Conversation
#ifdef __EMSCRIPTEN__ | ||
|
||
// XXX TODO: Might be nice to add support for standard flags. | ||
#define __SSE2__ |
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.
My instinct is that it isn't right for us to define target macros like this, even if we are emulating their APIs. We don't define __SSE__
, for comparison.
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.
No, that's correct, it's not intended to be defined there, but placed as temp for now, since Emscripten doesn't support -msse2
or similar command line flags. But I can remove that altogether as well.
Otherwise, this patch looks like a great start! |
Great, thanks! Addressed the review comments. |
I've put up a companion pull request to this in fastcomp at emscripten-core/emscripten-fastcomp#103 , and added several changes to this pull request as well. These together enable the compilation of SSE2 code, however it does not validate as asm.js, apparently because |
d6f1b85
to
f3e73d1
Compare
settings_changes.append('SSE2=1') | ||
newargs.append('-D__SSE__=1') | ||
newargs.append('-D__SSE2__=1') | ||
newargs[i] = '' |
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 think Emscripten accept -msse and -msse2 and predefine SSE and SSE2 is ok, though I am somewhat worried.
c0aab4a
to
e95003e
Compare
Ping @sunfishcode , this is now ready to be reviewed and merged from my end. Merging this requires support from emscripten-core/emscripten-fastcomp#103 first. |
8baa375
to
257b392
Compare
…ted from Clang instead of rewriting our own.
…ce, mfence and pause.
…in default suite, doesn't yet run in optimized suites.
…r renamed SIMD names.
…ts/runner.py ALL.test_simd ALL.test_simd2 ALL.test_simd3' and so on.
…k NaN canonicalization rules. (emscripten-core#3403)
Ping again @sunfishcode. Would you have some time to take a peek to this and the related emscripten-core/emscripten-fastcomp#103 PR? |
Overall this patch series looks good. My main concern now is the addition of -msse and -msse2 command-line options. We don't actually support those options in the way that x86 compilers do, so I'm not yet comfortable seeing them in emcc. Can you explain the need for these options in emcc? |
How do you mean we don't support these the way that x86 compilers do? If |
I discussed this with @kripken and am now ok with it. |
There appear to be a bunch of SIMD-related failures on the bots due to this and/or the other SIMD-related pull that landed today. |
Pushed http://git.io/vs0f7 to resolve the SIMD test failures. On my Windows system both SpiderMonkey and node.js now go cleanly through all the SIMD tests. I'm surprised to see new NaN canonicalization related issues though. If the bots don't get through these now, I might have to update node.js'es or SpiderMonkeys on them, I'll see about that once the dust settles. |
This improves our SSE2 support to compile more things by expanding the
emmintrin.h
. Not much to review here, except instead of rewriting the SSE2 support headers, this adapts the emmintrin.h directly from Clang, which is much cleaner. I am trying to run some stuff in Nightly, but it looks like things are in flux a bit due to SIMD.js spec renamings and that has regressed, so while some things compile with this, they can't be run in SpiderMonkey atm.