-
Notifications
You must be signed in to change notification settings - Fork 811
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
Add Windows support for the single-pass backend. #347
Comments
What's the status of this? I'm at least partially blocked by this. (With enough mentoring I could maybe do this, but I already looked at this a while ago and it seems like there's one huge asm block (for setup or something, I don't remember), where I did have absolutely no clue how that would need to be modified for Windows compatibility). |
Thanks for your interest in helping with this issue! For the To support windows, what needs to be done is to figure out where each argument should be placed before a function call and what extra ABI constraints need to be satisfied. So instead of |
Any updates for this? Would be nice to have it available on Windows |
Our work in the refactor will make this much easier to happen |
We have done this in #2574. Closing the issue |
[SDK-3] Finalise the public API
Currently the single-pass backend assumes a System V calling convention, but Windows has its own one instead of System V.
It shouldn't be hard to support Windows' calling convention on x64. The following changes need to be made:
In
machine.rs
:get_param_location
that defines where function arguments should be located.REGS
inpick_gpr
andpick_temp_gpr
.XMM6
andXMM7
inpick_xmm
(since Windows requires them to be preserved, while we cannot decide whether this needs to be done in a single pass).In
codegen_x64.rs
:CONSTRUCT_STACK_AND_CALL_WASM
.emit_call_sysv
toemit_call
.call
inemit_call
.EDIT: Windows support is more complex to implement than I thought before because the Windows x64 ABI does not guarantee a 128-byte red zone, which the code generator currently uses everywhere.FixedThe text was updated successfully, but these errors were encountered: