Skip to content

Commit

Permalink
Rollup merge of rust-lang#47541 - psumbera:master, r=eddyb
Browse files Browse the repository at this point in the history
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: rust-lang#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.
  • Loading branch information
kennytm authored Jan 23, 2018
2 parents 150f2ba + 1203b3d commit 82981a7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/librustc_trans/cabi_sparc64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fn classify_ret_ty<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>, ret: &mut ArgType<'tcx>)
}
let size = ret.layout.size;
let bits = size.bits();
if bits <= 128 {
if bits <= 256 {
let unit = if bits <= 8 {
Reg::i8()
} else if bits <= 16 {
Expand Down Expand Up @@ -84,6 +84,11 @@ fn classify_arg_ty<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>, arg: &mut ArgType<'tcx>)
}

let total = arg.layout.size;
if total.bits() > 128 {
arg.make_indirect();
return;
}

arg.cast_to(Uniform {
unit: Reg::i64(),
total
Expand Down

0 comments on commit 82981a7

Please sign in to comment.