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/
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.
@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
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
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
Thanks for the tips, and for clarifying expectations!
Last updated: Dec 23 2024 at 12:05 UTC