Return values up to 128 bits in registers
This commit is contained in:
parent
6f9a8a7f9b
commit
4c5acc4ed7
2 changed files with 20 additions and 4 deletions
|
@ -610,3 +610,15 @@ impl<'a, Ty> FnAbi<'a, Ty> {
|
|||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the maximum size of return values to be passed by value in the Rust ABI.
|
||||
///
|
||||
/// Return values beyond this size will use an implicit out-pointer instead.
|
||||
pub fn max_ret_by_val<C: HasTargetSpec + HasDataLayout>(spec: &C) -> Size {
|
||||
match spec.target_spec().arch.as_str() {
|
||||
// System-V will pass return values up to 128 bits in RAX/RDX.
|
||||
"x86_64" => Size::from_bits(128),
|
||||
|
||||
_ => spec.data_layout().pointer_size,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue