Stream: git-wasmtime

Topic: wasmtime / PR #14361 allow returns via `xmm1` with `Windo...


view this post on Zulip Wasmtime GitHub notifications bot (Sep 19 2026 at 17:13):

folkertdev opened PR #14361 from folkertdev:rust-windows-float-scalar-pair to bytecodealliance:main:

This fixes this issue in rustc_codegen_cranelift

and is in line with a similar solution in get_intreg_for_retval right above

        CallConv::WindowsFastcall => match intreg_idx {
            0 => Some(regs::rax()),
            1 => Some(regs::rdx()), // The Rust ABI for i128s needs this.
            _ => None,
        },

The rust calling convention uses xmm0 and xmm1 for returning float scalar pairs. Previously cranelift would return one of the floats via xmm0 and the other via an outpointer, which is obviously not abi-compatible.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 19 2026 at 17:13):

folkertdev requested fitzgen for a review on PR #14361.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 19 2026 at 17:13):

folkertdev requested wasmtime-compiler-reviewers for a review on PR #14361.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 19 2026 at 17:15):

folkertdev commented on PR #14361:

Presumably this needs a test but I'm not sure how that works or where it would go.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 19 2026 at 17:22):

cfallin commented on PR #14361:

Presumably this needs a test but I'm not sure how that works or where it would go.

Thanks! We have compiler-output golden tests as "filetests" in cranelift/filetests/filetests -- a test in isa/x64 that has a small fastcall function with two float returns would be great.

If you write just the test preamble (test compile precise-output / target x86_64) and CLIF function itself, you can CRANELIFT_TEST_BLESS=1 cargo run -p cranelift-tools -- test .../test.clif to "bless" new output (in this case, initially put the expectation in the file).

view this post on Zulip Wasmtime GitHub notifications bot (Sep 19 2026 at 17:33):

folkertdev updated PR #14361.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 19 2026 at 17:35):

:memo: folkertdev submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 19 2026 at 17:35):

:speech_balloon: folkertdev created PR review comment:

I think I got it. I'm swapping v1, v0 so the body cannot be optimized out (even though it maybe wouldn't today).

view this post on Zulip Wasmtime GitHub notifications bot (Sep 19 2026 at 18:45):

github-actions[bot] added the label cranelift on PR #14361.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 19 2026 at 18:45):

github-actions[bot] added the label cranelift:area:x64 on PR #14361.


Last updated: Sep 20 2026 at 18:08 UTC