BPF: abi: extend args/ret to 32 bits
Let LLVM extend to 64 bits when alu32 is not enabled
This commit is contained in:
parent
9cf2170a79
commit
bd8e5ce4b9
1 changed files with 3 additions and 3 deletions
|
@ -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};
|
use crate::abi::call::{ArgAbi, FnAbi};
|
||||||
|
|
||||||
fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
|
fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
|
||||||
if ret.layout.is_aggregate() || ret.layout.size.bits() > 64 {
|
if ret.layout.is_aggregate() || ret.layout.size.bits() > 64 {
|
||||||
ret.make_indirect();
|
ret.make_indirect();
|
||||||
} else {
|
} 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 {
|
if arg.layout.is_aggregate() || arg.layout.size.bits() > 64 {
|
||||||
arg.make_indirect();
|
arg.make_indirect();
|
||||||
} else {
|
} else {
|
||||||
arg.extend_integer_width_to(64);
|
arg.extend_integer_width_to(32);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue