-
Notifications
You must be signed in to change notification settings - Fork 63
Squash of fastcomp commit 4105790f1549808c1f1daa5250b4ada5f41a5c02 #50
Squash of fastcomp commit 4105790f1549808c1f1daa5250b4ada5f41a5c02 #50
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
// is quite desirable. | ||
if (isSplat || newMask == LHSMask || newMask == RHSMask || newMask == Mask || | ||
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.
This seems pretty suspicious in the sense that it's a change made with the assumption that LLVM is only generating asmjs. I wonder if we should back this out?
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've checked with @sunfish and we can revert this with little performance impact on asmjs. I will do so.
f19e5a4
to
af0684e
Compare
@alexcrichton I've added a patch to revert two of the changes and determined that the others should not affect us. |
af0684e
to
8d07d6d
Compare
Tally ho! |
Working asmjs and wasm targets This patch set results in a working standard library for the asmjs-unknown-emscripten and wasm32-unknown-emscripten targets. It is based on the work of @badboy and @rschulman. It does a few things: - Updates LLVM with the emscripten [fastcomp](rust-lang/llvm#50) patches, which include the pnacl IR legalizer and the asm.js backend. This patch is thought not to have any significant effect on existing targets. - Teaches rustbuild to correctly link C code with emscripten - Updates gcc-rs to work correctly with emscripten - Teaches rustbuild to run crate tests for emscripten with node - Modifies Thread::new to return an error on emscripten, to facilitate debugging a common failure mode - Modifies libtest to run in single-threaded mode for emscripten - Ignores a host of tests that don't work yet, mostly dealing with threads and I/O - Updates libc with wasm32 definitions (presently the same as asmjs) - Adds a wasm32-unknown-emscripten target that feeds the output of LLVM's asmjs backend through emcc to generate wasm Notes and caveats: - This is only known to work with `--enable-rustbuild`. - The wasm32 target can't be tested correctly yet because of issues in compiletest and limitations in node emscripten-core/emscripten#4542, but hello.rs does seem to work when run on node via the binaryen interpreter - This requires an up to date installation of the emscripten sdk from its incoming branch - Unwinding is very broken - When enabling the emscripten targets jemalloc is disabled for all targets, which results in test failures for the host Next steps are to fix the jemalloc issue, start building the two emscripten targets on the auto builders, then start producing nightlies. #36317 tracks work on this. Fixes #36515 Fixes #36515 Fixes #36356
This is the entire content of the emscripten fastcomp LLVM fork, which it uses to generate asm.js and which can also be used to generate wasm. By importing this into our tree we can do the same, by emitting LLVM IR that emscripten's emcc compiler understands.
The vast majority of the code here belongs to the pnacl IR legalizer and to the asmjs backend, though there are a few bits that touch common code. As such, I expect this to be relatively easy to maintain, the maintenance model being:
The only reason I expect emscripten to need to upgrade LLVM in the future is to move to the upstream wasm backend, which we will also want. So there is in fact the possibility we will be looking forward to quite a bit of llvm churn in the near future.
Once the LLVM wasm backend is complete we can consider dropping this patch, though at that time will either need to also drop asm.js support or invest considerable effort into a wasm2asmjs code path.
Once this is merged and the libc patches for wasm merged, I will submit a patch to Rust adding more-or-less working asmjs/wasm32 targets.
r? @alexcrichton