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

Initial support for x64 windows calling convention on the single pass compiler #1998

Closed
wants to merge 1 commit into from

Conversation

Pombal
Copy link

@Pombal Pombal commented Jan 10, 2021

Hello, I started implementing some of the changes @losfair mentioned in this issue: #347

Some simple functions already work but more complicated ones do not. An example of a function that doesn't work is double_then_add below:

(module
            (func $multiply (import "env" "multiply") (param i32 i32) (result i32))
            (func (export "add") (param i32 i32) (result i32)
               (i32.add (local.get 0)
                        (local.get 1)))
            (func (export "double_then_add") (param i32 i32) (result i32)
               (i32.add (call $multiply (local.get 0) (i32.const 2))
                        (call $multiply (local.get 1) (i32.const 2))))
        )

This probably has to do with proper handling of the 32 byte shadow space which I haven't added.
emit_call_sysv in codegen_x64.rs would have to be modified for this to work but the code has changed. @losfair mentioned a CONSTRUCT_STACK_AND_CALL_WASM which doesn't seem to exist anymore.

Ideally a maintainer would take this proof of concept and complete it. But with some guidance on better workflows for debugging the generated code on windows I can implement the missing functionality.

@Hywan Hywan added 🎉 enhancement New feature! 📦 lib-compiler-singlepass About wasmer-compiler-singlepass labels Jan 11, 2021
@Hywan Hywan mentioned this pull request Jul 13, 2021
3 tasks
@webmaster128
Copy link
Contributor

Can this be closed after #2574 was merged?

@Pombal Pombal closed this Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎉 enhancement New feature! 📦 lib-compiler-singlepass About wasmer-compiler-singlepass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants