Skip to content
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

64bit support #104

Closed
dvc94ch opened this issue Nov 12, 2021 · 2 comments
Closed

64bit support #104

dvc94ch opened this issue Nov 12, 2021 · 2 comments
Labels
open question Big topics that have no clear answer at this time

Comments

@dvc94ch
Copy link

dvc94ch commented Nov 12, 2021

Was wondering what your thoughts are on how it should work. There seems to be a lot of different approaches that kind of work and it's not clear what is the most sensible one. Some options are listed below:

  • add a ptr type to WasmType that generates an isize with corresponding load/store instructions
    • the abi has hard coded offsets so it seems that the parser crate needs to know if it's 32/64bit
  • add a parameter to the abi
    • the abi is currently hardcoded for every function, so it's not clear how to inject the pointer width
  • add a configurable pointer width in addition to Interface and AbiVariant, the Generator trait passes an enum WasmPtr { I32, I64 }

dealing with handles:

  • it is not clear if the handle index should always be an i32 on 64bit platforms, or if this is an additional configuration option (as on native it is just a ptr)
  • the handle cannot be an isize as the host ptr width is irrelevant, so it probably has to be generic. making it generic leaks abi details, as the handle is part of the public api
@alexcrichton
Copy link
Member

I don't think much thought has gone into the specifics of what this would look like in the code itself, but naively I would expect that the WasmType enum would change but instead there'd be some sort of configuration passed in when generating bindings whether it's for 32-bit or 64-bit. There aren't a ton of 64-bit use cases right now so this is still up-in-the-air.

As for handles I don't believe there has been much discussion about whether they should always use 32-bit indices or 64-bit indices.

@alexcrichton alexcrichton added the open question Big topics that have no clear answer at this time label May 3, 2022
@alexcrichton
Copy link
Member

I'm going to close this in favor of WebAssembly/component-model#22 since memory64 hasn't been defined relative to the component model yet and that will need to happen before support can be implemented here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open question Big topics that have no clear answer at this time
Projects
None yet
Development

No branches or pull requests

2 participants