Skip to content

Commit bd8e5ce

Browse files
committed
BPF: abi: extend args/ret to 32 bits
Let LLVM extend to 64 bits when alu32 is not enabled
1 parent 9cf2170 commit bd8e5ce

File tree

1 file changed

+3
-3
lines changed
  • compiler/rustc_target/src/abi/call

1 file changed

+3
-3
lines changed

compiler/rustc_target/src/abi/call/bpf.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
// see BPFCallingConv.td
1+
// see https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/BPF/BPFCallingConv.td
22
use crate::abi::call::{ArgAbi, FnAbi};
33

44
fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
55
if ret.layout.is_aggregate() || ret.layout.size.bits() > 64 {
66
ret.make_indirect();
77
} else {
8-
ret.extend_integer_width_to(64);
8+
ret.extend_integer_width_to(32);
99
}
1010
}
1111

1212
fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
1313
if arg.layout.is_aggregate() || arg.layout.size.bits() > 64 {
1414
arg.make_indirect();
1515
} else {
16-
arg.extend_integer_width_to(64);
16+
arg.extend_integer_width_to(32);
1717
}
1818
}
1919

0 commit comments

Comments
 (0)