Skip to content

Commit

Permalink
BPF: abi: extend args/ret to 32 bits
Browse files Browse the repository at this point in the history
Let LLVM extend to 64 bits when alu32 is not enabled
  • Loading branch information
alessandrod committed May 29, 2021
1 parent 9cf2170 commit bd8e5ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_target/src/abi/call/bpf.rs
@@ -1,19 +1,19 @@
// 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);
}
}

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);
}
}

Expand Down

0 comments on commit bd8e5ce

Please sign in to comment.