mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-25 14:13:38 +00:00
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
This commit is contained in:
parent
0f9c784751
commit
f4bcfc5317
@ -24,7 +24,7 @@ fn is_homogeneous_aggregate<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>, arg: &mut ArgTyp
|
|||||||
let valid_unit = match unit.kind {
|
let valid_unit = match unit.kind {
|
||||||
RegKind::Integer => false,
|
RegKind::Integer => false,
|
||||||
RegKind::Float => true,
|
RegKind::Float => true,
|
||||||
RegKind::Vector => arg.layout.size.bits() == 128
|
RegKind::Vector => arg.layout.size.bits() == 256
|
||||||
};
|
};
|
||||||
|
|
||||||
if valid_unit {
|
if valid_unit {
|
||||||
@ -50,7 +50,7 @@ fn classify_ret_ty<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>, ret: &mut ArgType<'tcx>)
|
|||||||
}
|
}
|
||||||
let size = ret.layout.size;
|
let size = ret.layout.size;
|
||||||
let bits = size.bits();
|
let bits = size.bits();
|
||||||
if bits <= 128 {
|
if bits <= 256 {
|
||||||
let unit = if bits <= 8 {
|
let unit = if bits <= 8 {
|
||||||
Reg::i8()
|
Reg::i8()
|
||||||
} else if bits <= 16 {
|
} 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;
|
let total = arg.layout.size;
|
||||||
|
if total.bits() > 128 {
|
||||||
|
arg.make_indirect(cx);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
arg.cast_to(Uniform {
|
arg.cast_to(Uniform {
|
||||||
unit: Reg::i64(),
|
unit: Reg::i64(),
|
||||||
total
|
total
|
||||||
|
Loading…
Reference in New Issue
Block a user