summaryrefslogtreecommitdiff
path: root/user/rust/ppc64-abi.patch
diff options
context:
space:
mode:
Diffstat (limited to 'user/rust/ppc64-abi.patch')
-rw-r--r--user/rust/ppc64-abi.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/user/rust/ppc64-abi.patch b/user/rust/ppc64-abi.patch
new file mode 100644
index 000000000..9034d267f
--- /dev/null
+++ b/user/rust/ppc64-abi.patch
@@ -0,0 +1,33 @@
+Upstream: https://github.com/rust-lang/rust/issues/128579
+
+diff --git a/compiler/rustc_target/src/abi/call/powerpc64.rs b/compiler/rustc_target/src/abi/call/powerpc64.rs
+index 11a6cb52bab..4212871389c 100644
+--- a/compiler/rustc_target/src/abi/call/powerpc64.rs
++++ b/compiler/rustc_target/src/abi/call/powerpc64.rs
+@@ -69,19 +69,15 @@ fn classify_ret<'a, Ty, C>(cx: &C, ret: &mut ArgAbi<'a, Ty>, abi: ABI)
+ let size = ret.layout.size;
+ let bits = size.bits();
+ if bits <= 128 {
+- let unit = if cx.data_layout().endian == Endian::Big {
+- Reg { kind: RegKind::Integer, size }
+- } else if bits <= 8 {
+- Reg::i8()
+- } else if bits <= 16 {
+- Reg::i16()
+- } else if bits <= 32 {
+- Reg::i32()
++ if bits <= 64 {
++ ret.cast_to(Uniform::new(Reg { kind: RegKind::Integer, size }, size))
+ } else {
+- Reg::i64()
++ let reg = if ret.layout.align.abi.bytes() > 8 { Reg::i128() } else { Reg::i64() };
++ ret.cast_to(Uniform::consecutive(
++ reg,
++ size.align_to(Align::from_bytes(reg.size.bytes()).unwrap()),
++ ))
+ };
+-
+- ret.cast_to(Uniform::new(unit, size));
+ return;
+ }
+