-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Closed
Labels
A-ABIArea: Concerning the application binary interface (ABI)Area: Concerning the application binary interface (ABI)C-bugCategory: This is a bug.Category: This is a bug.O-wasmTarget: WASM (WebAssembly), http://webassembly.org/Target: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
According to https://github.com/WebAssembly/tool-conventions/blob/main/BasicCABI.md __int128 and long long double have to be returned indirectly. In
rust/compiler/rustc_target/src/callconv/wasm.rs
Lines 21 to 30 in 2776bdf
| 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(); | |
| } | |
| } |
.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.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-ABIArea: Concerning the application binary interface (ABI)Area: Concerning the application binary interface (ABI)C-bugCategory: This is a bug.Category: This is a bug.O-wasmTarget: WASM (WebAssembly), http://webassembly.org/Target: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.