Skip to content

Commit b401404

Browse files
committed
use indirect return for i128 and f128 on wasm32
1 parent 93ba568 commit b401404

File tree

1 file changed

+9
-0
lines changed
  • compiler/rustc_target/src/callconv

1 file changed

+9
-0
lines changed

compiler/rustc_target/src/callconv/wasm.rs

+9
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ where
2727
if ret.layout.is_aggregate() && !unwrap_trivial_aggregate(cx, ret) {
2828
ret.make_indirect();
2929
}
30+
31+
// `long double`, `__int128t` and `__uint128_t` use an indirect return
32+
if let ustc_abi::BackendRepr::Scalar(scalar) = ret.layout.backend_repr {
33+
match scalar.primitive() {
34+
rustc_abi::Primitive::Int(rustc_abi::Integer::I128, _) => ret.make_indirect(),
35+
rustc_abi::Primitive::Float(rustc_abi::Float::F128) => ret.make_indirect(),
36+
_ => {}
37+
}
38+
}
3039
}
3140

3241
fn classify_arg<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>)

0 commit comments

Comments
 (0)