-
Notifications
You must be signed in to change notification settings - Fork 1.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
Finish implementing x86 32-bits #1089
Comments
Support for i686 (32-bit x86) is currently incomplete. A lot of the major pieces are in place, since we tend to implement the 32-bit x86 parts along with the 64-bit x86 parts, however it hasn't been tested yet, and there are a few more 32-bit-specific pieces needed. |
Add encodings for iadd carry variants (iadd_cout, iadd_cin, iadd_carry) for x86_32, enabling the legalization for iadd.i64 to work. Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1576675 Bug: https://github.com/CraneStation/cranelift/issues/765
Add encodings for isub borrow variants (isub_bout, isub_bin, isub_borrow) for x86_32, enabling the legalization for isub.i64 to work. Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1576675 Bug: https://github.com/CraneStation/cranelift/issues/765
Add encodings for isub borrow variants (isub_bout, isub_bin, isub_borrow) for x86_32, enabling the legalization for isub.i64 to work. Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1576675 Bug: https://github.com/CraneStation/cranelift/issues/765
Add encodings for isub borrow variants (isub_bout, isub_bin, isub_borrow) for x86_32, enabling the legalization for isub.i64 to work. Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1576675 Bug: https://github.com/CraneStation/cranelift/issues/765
Add encodings for isub borrow variants (isub_bout, isub_bin, isub_borrow) for x86_32, enabling the legalization for isub.i64 to work. Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1576675 Bug: https://github.com/CraneStation/cranelift/issues/765
Add encodings for isub borrow variants (isub_bout, isub_bin, isub_borrow) for x86_32, enabling the legalization for isub.i64 to work. Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1576675 Bug: https://github.com/CraneStation/cranelift/issues/765
I'm very interested in seeing this issue fixed, since it has a significant impact on the usefulness of wasmtime-py; if you navigate to python.org on Windows, either 32-bit or 64-bit, it always suggests you a 32-bit Python build, so most people certainly end up with 32-bit Python that cannot run wasmtime.pyd. Not only that, but the link to the 64-bit installer is somewhat hard to find, and there AFAIK isn't a redirect I can send to people to ask them to install 64-bit Python that is compatible with wasmtime-py. Could one of the developers more familiar with the codebase provide some guidance? I've tried running a few WASI applications with wasmtime targeting i686 Linux but they all crash with a constraint issue that only ever mentions x86_64 registers (
(I do understand that a Windows port is more complex--I've heard that SEH is going to be involved--but even an i686 Linux port would be useful, both on its own and as a starting point.) |
Thank you for bringing this up, and for starting to work on it! I at least wasn't aware of the unfortunate situation with 64-bit Python on Windows, which I agree makes this more important. One thing to be aware of is that we're in the middle of a pretty big change to Cranelift, involving a rewrite of the instruction selector (and register allocator, but I don't think that's too important here.) I'm not sure how that factors in, but @cfallin, @bnjbvr, or @julian-seward1 would. |
Hi @whitequark and thanks for working on it! As Till pointed out, we're in the middle of switching the instruction selection and codegen backends in Cranelift. As a matter of fact, we're rewriting the codegen bits, which include recipes/encodings and all of this, to a simpler and more straightforward system (see for example the new At this point, the current meta system should be considered in maintenance-only mode. Note that since the two codegen backend frameworks are very different, we won't be able to port x86 32 bits changes to the old backend onto the new backend, so this work will likely be thrown away. Since there might be some time until we get to the final switch to the new system (and plain removal of the previous one), I don't think we should get in the way of good will. Meaning that if people want to submit patches, and other people want to review them, this is totally fine; this is useful up to the point where we switch to the new system. Note there is a work-in-progress PR for a new x64 backend. This code could be a great base for a new x86 32-bits backend too, duplicating code for a new codegen backend, or sharing and reusing most of the x64 code there. |
Ah, I see. In that case I would probably not put any effort towards a Windows port until the x64 backend is ready. |
I think this should be closed in favor of #1980. |
Sure, they both seem to be tracking the same thing; will close this one. |
Sources
sources.zip
cb.wasm was compiled with Emscripten 1.18.31 + stock LLVM with:
Behavior
Compiling this wasm with
clif-util wasm --target i686 ~/code/git/wasm-sandboxing/build/cb.wasm
with 42bd100 gives outverifier error: Store must have an encoding
. Log is attached hereThe text was updated successfully, but these errors were encountered: