1
Fork 0

BPF: abi: extend args/ret to 32 bits

Let LLVM extend to 64 bits when alu32 is not enabled
This commit is contained in:
Alessandro Decina 2021-05-29 22:18:30 +10:00
parent 9cf2170a79
commit bd8e5ce4b9

View file

@ -1,11 +1,11 @@
// see BPFCallingConv.td
// see https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/BPF/BPFCallingConv.td
use crate::abi::call::{ArgAbi, FnAbi};
fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
if ret.layout.is_aggregate() || ret.layout.size.bits() > 64 {
ret.make_indirect();
} else {
ret.extend_integer_width_to(64);
ret.extend_integer_width_to(32);
}
}
@ -13,7 +13,7 @@ fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
if arg.layout.is_aggregate() || arg.layout.size.bits() > 64 {
arg.make_indirect();
} else {
arg.extend_integer_width_to(64);
arg.extend_integer_width_to(32);
}
}