Stream: git-wasmtime

Topic: wasmtime / issue #9250 Cranelift: Incorrect abi for i128,...


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

bjorn3 added the bug label to Issue #9250.

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

bjorn3 added the cranelift label to Issue #9250.

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

bjorn3 opened issue #9250:

Expected Results

All return values are returned using a single return pointer.

Actual Results

Return values are put into registers where possible and on the stack for the rest.

Versions and Environment

Cranelift version or commit: 0.111

Operating system: Linux

Architecture: x86_64

Extra Info

This is one of the causes for https://github.com/rust-lang/rustc_codegen_cranelift/issues/1525. The same issue may exist on aarch64 and other archs too, but haven't checked yet.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 16 2024 at 19:21):

bjorn3 commented on issue #9250:

PR's opened while working on this:

view this post on Zulip Wasmtime GitHub notifications bot (Sep 16 2024 at 19:41):

bjorn3 commented on issue #9250:

Found another issue: The x86_64 and riscv64 backends add an implicit return pointer after all other arguments rather than as first argument.

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

bjorn3 edited a comment on issue #9250:

PR's opened while working on this:

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

bjorn3 edited a comment on issue #9250:

Found another issue: The x86_64 and riscv64 backends add an implicit return pointer after all other arguments rather than as first argument.

Edit: Fixed in https://github.com/bytecodealliance/wasmtime/pull/9267

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

bjorn3 edited a comment on issue #9250:

PR's opened while working on this:

view this post on Zulip Wasmtime GitHub notifications bot (Sep 19 2024 at 19:44):

bjorn3 edited a comment on issue #9250:

PR's opened while working on this:

view this post on Zulip Wasmtime GitHub notifications bot (Oct 03 2024 at 13:15):

bjorn3 commented on issue #9250:

Expected Results

All return values are returned using a single return pointer.

Actually, LLVM passes the return value on the stack if it doesn't fit in registers. It doesn't use a return area pointer.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 03 2024 at 14:21):

bjorn3 edited a comment on issue #9250:

Expected Results

All return values are returned using a single return pointer.

Actually, LLVM passes the return value on the stack if it doesn't fit in registers. It doesn't use a return area pointer.

Edit: Never mind. I was wrong about this.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 19 2024 at 17:14):

bjorn3 commented on issue #9250:

As of https://github.com/rust-lang/rust/pull/131211 rustc should no longer emit this return type. If this is indeed the case, I propose to deny any return type that doesn't fit in the abi designated return value registers for at least the system_v and windows_fastcall call convs. And ideally also for every other call conv to be able to get rid of the implicit sret argument introduction in the abi calculation code which complicates this code by a fair bit.


Last updated: Nov 22 2024 at 17:03 UTC