mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-26 14:43:24 +00:00
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.
This commit is contained in:
commit
82981a77c4
@ -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 {
|
||||
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user