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.
According to https://github.com/WebAssembly/tool-conventions/blob/main/BasicCABI.md
__int128andlong long doublehave to be returned indirectly. Inrust/compiler/rustc_target/src/callconv/wasm.rs
Lines 21 to 30 in 2776bdf
.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.