Skip to content

ABI adjustment code for wasm doesn't handle 128bit ints and floats #135532

Closed
@bjorn3

Description

@bjorn3

According to https://github.com/WebAssembly/tool-conventions/blob/main/BasicCABI.md __int128 and long long double have to be returned indirectly. In

fn classify_ret<'a, Ty, C>(cx: &C, ret: &mut ArgAbi<'a, Ty>)
where
Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout,
{
ret.extend_integer_width_to(32);
if ret.layout.is_aggregate() && !unwrap_trivial_aggregate(cx, ret) {
ret.make_indirect();
}
}
however we are not doing .make_indirect() for i128 and f128. It currently works by accident as LLVM implicitly introduces a return area pointer when returning i128 and f128, but other backends and other code that needs to know the ABI may not be able to handle this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ABIArea: Concerning the application binary interface (ABI)C-bugCategory: This is a bug.O-wasmTarget: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions