1
Fork 0

Restore previous ABI for f_single_u8_arg

This commit is contained in:
bjorn3 2024-12-06 09:46:41 +00:00
parent 062bc02dc7
commit 1c1c13a184
2 changed files with 11 additions and 2 deletions

View file

@ -75,7 +75,16 @@ where
16 => Reg::i128(),
_ => unreachable!("Align is given as power of 2 no larger than 16 bytes"),
};
arg.cast_to(Uniform::new(unit, arg.layout.size));
if arg.layout.size.bytes() / align_bytes == 1 {
// Make sure we pass the struct as array at the LLVM IR level and not as a single integer.
arg.cast_to(CastTarget {
prefix: [Some(unit), None, None, None, None, None, None, None],
rest: Uniform::new(unit, Size::ZERO),
attrs: ArgAttributes::new(),
});
} else {
arg.cast_to(Uniform::new(unit, arg.layout.size));
}
}
pub(crate) fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {