Skip to content

Commit 82981a7

Browse files
authored
Rollup merge of #47541 - psumbera:master, r=eddyb
Fixes sparc64 cabi fixes. Argument up to 16 bytes size is provided in registers. Return value up to 32 bytes size is stored in registers. Fixes: #46679 --- Firefox now (almost) build on sparc. Original rust issue seems to be gone. Note that I'm not rust expert and the fix was suggested in bug.
2 parents 150f2ba + 1203b3d commit 82981a7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/librustc_trans/cabi_sparc64.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fn classify_ret_ty<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>, ret: &mut ArgType<'tcx>)
5050
}
5151
let size = ret.layout.size;
5252
let bits = size.bits();
53-
if bits <= 128 {
53+
if bits <= 256 {
5454
let unit = if bits <= 8 {
5555
Reg::i8()
5656
} else if bits <= 16 {
@@ -84,6 +84,11 @@ fn classify_arg_ty<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>, arg: &mut ArgType<'tcx>)
8484
}
8585

8686
let total = arg.layout.size;
87+
if total.bits() > 128 {
88+
arg.make_indirect();
89+
return;
90+
}
91+
8792
arg.cast_to(Uniform {
8893
unit: Reg::i64(),
8994
total

0 commit comments

Comments
 (0)