-
Notifications
You must be signed in to change notification settings - Fork 13.4k
BPF target support #79608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BPF target support #79608
Changes from 7 commits
12e7092
25b3c88
cf5ac62
12ac719
b2a6967
49f9d73
6b27795
ec0382e
9cf2170
bd8e5ce
ab93a13
ab86acd
ee07447
0adb933
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,6 +86,7 @@ fn main() { | |
"nvptx", | ||
"hexagon", | ||
"riscv", | ||
"bpf", | ||
]; | ||
|
||
let required_components = &[ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// see 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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAIU when alu32 feature is enabled, the 32-bit values are expected to be passed in the Perhaps you could always extend to just 32 bits and let LLVM handle extending to 64 bits if alu32 is not enabled? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes good point, I've done that. |
||
} | ||
} | ||
|
||
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); | ||
} | ||
} | ||
|
||
pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) { | ||
if !fn_abi.ret.is_ignore() { | ||
classify_ret(&mut fn_abi.ret); | ||
} | ||
|
||
for arg in &mut fn_abi.args { | ||
if arg.is_ignore() { | ||
continue; | ||
} | ||
classify_arg(arg); | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.