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>) {

View file

@ -166,7 +166,7 @@ pub unsafe extern "ptx-kernel" fn f_f32_arg(_a: f32) {}
pub unsafe extern "ptx-kernel" fn f_f64_arg(_a: f64) {}
// CHECK: .visible .entry f_single_u8_arg(
// CHECK: .param .u8 f_single_u8_arg_param_0
// CHECK: .param .align 1 .b8 f_single_u8_arg_param_0[1]
#[no_mangle]
pub unsafe extern "ptx-kernel" fn f_single_u8_arg(_a: SingleU8) {}