Stream: general

Topic: x86_32 Support


view this post on Zulip Ryan Nguyen (Sep 27 2024 at 01:52):

Hi, I wanted to pick up this issue and take a stab at it: https://github.com/bytecodealliance/wasmtime/issues/1980

Are there any relevant documentation to this, or pointers on where to get started? I'm currently taking a look at cranelift/codegen/src/isa/x64/

We don't currently have fully working x86 support, but we have a backend in-tree that's largely completely. However, it uses the old instructions selection framework, and as described in #1936, Cra...

view this post on Zulip Alex Crichton (Sep 27 2024 at 15:23):

Hello! You'll probably want to read over existing backends to get started, but it's worth pointing out that all backends at this time are 64-bit so that's probably going to be one of the more significant tasks to take on for this backend.

view this post on Zulip Chris Fallin (Sep 27 2024 at 15:26):

@Ryan Nguyen the one 32-bit-specific thing is in ValueRegs, where we define the maximum number of machine registers that an SSA value takes; that will have to be 4 instead of 2 when x86-32 is enabled

view this post on Zulip Chris Fallin (Sep 27 2024 at 15:28):

Otherwise the big-picture question here is how much reuse we can get from the x64 backend. The heart of the instruction encodings are the same, except of course where they aren't (operand length prefixes etc, no REX bytes, ...); it will probably take some investigation to see if we can extract an "assembler library" (probably still a different MachInst enum def) or start with a simple copy

view this post on Zulip Chris Fallin (Sep 27 2024 at 15:30):

Finally, just to make sure there aren't any mismatching expectations -- I expect a basic "Wasm 1.0 functional" x86-32 backend is probably a month or so of fulltime work for someone familiar with Cranelift backends already, 2-3 months if this is a "starter project". We're very happy to answer questions! But not a small task

view this post on Zulip Ryan Nguyen (Sep 30 2024 at 13:46):

Thanks for the tips, and for clarifying expectations!


Last updated: Nov 22 2024 at 16:03 UTC