Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f4bcfc5

Browse files
committedJan 18, 2018
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
1 parent 0f9c784 commit f4bcfc5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
 

‎src/librustc_trans/cabi_sparc64.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fn is_homogeneous_aggregate<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>, arg: &mut ArgTyp
2424
let valid_unit = match unit.kind {
2525
RegKind::Integer => false,
2626
RegKind::Float => true,
27-
RegKind::Vector => arg.layout.size.bits() == 128
27+
RegKind::Vector => arg.layout.size.bits() == 256
2828
};
2929

3030
if valid_unit {
@@ -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(cx);
89+
return;
90+
}
91+
8792
arg.cast_to(Uniform {
8893
unit: Reg::i64(),
8994
total

0 commit comments

Comments
 (0)
Please sign in to comment.