Skip to content

Commit baf46d2

Browse files
committed
[cc] aarch64 fixes
1 parent a1be1cb commit baf46d2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cc/arch/aarch64/codegen.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2928,11 +2928,12 @@ impl Aarch64CodeGen {
29282928
let mut fp_arg_idx = 0;
29292929
let mut stack_args = 0;
29302930

2931-
// Check if this call returns a large struct (> 16 bytes)
2931+
// Check if this call returns a large struct (> 8 bytes)
29322932
// If so, the first argument is the sret pointer and goes in X8 (not X0)
2933+
// Note: Must match linearizer threshold of > 64 bits
29332934
let returns_large_struct = insn.typ.as_ref().is_some_and(|t| {
29342935
(t.kind == crate::types::TypeKind::Struct || t.kind == crate::types::TypeKind::Union)
2935-
&& t.size_bits() > 128
2936+
&& t.size_bits() > 64
29362937
});
29372938

29382939
// Also check if return type is a pointer to a large struct (linearizer wraps it)
@@ -2941,7 +2942,7 @@ impl Aarch64CodeGen {
29412942
if let Some(pointee) = t.get_base() {
29422943
(pointee.kind == crate::types::TypeKind::Struct
29432944
|| pointee.kind == crate::types::TypeKind::Union)
2944-
&& pointee.size_bits() > 128
2945+
&& pointee.size_bits() > 64
29452946
} else {
29462947
false
29472948
}

0 commit comments

Comments
 (0)