bytecodealliance / wasmtime

A fast and secure runtime for WebAssembly
https://wasmtime.dev/
Apache License 2.0
15.16k stars 1.27k forks source link

Cranelift: Incorrect abi for i128, i128 return value on x86_64 sysv #9250

Open bjorn3 opened 1 week ago

bjorn3 commented 1 week ago

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.

bjorn3 commented 6 days ago

PR's opened while working on this:

bjorn3 commented 6 days ago

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