Skip to content
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

Added LLVM intrinsics compile option #38

Merged
merged 3 commits into from
Dec 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions compile/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ pub struct Config {
woff: bool,
wno_perf: bool,
instrument: bool,
enable_llvm_intrinsics: bool,
target_isa: Option<Vec<TargetISA>>,
architecture: Option<Architecture>,
target_os: Option<TargetOS>,
Expand Down Expand Up @@ -153,6 +154,7 @@ impl Config {
woff: false,
wno_perf: false,
instrument: false,
enable_llvm_intrinsics: false,
target_isa: None,
architecture: None,
target_os: None,
Expand Down Expand Up @@ -278,6 +280,11 @@ impl Config {
self.instrument = true;
self
}
/// Enable support for LLVM intrinsics
pub fn enable_llvm_intrinsics(&mut self) -> &mut Config {
self.enable_llvm_intrinsics = true;
self
}
/// Select the target ISA and vector width. If none is specified ispc will
/// choose the host CPU ISA and vector width.
pub fn target_isa(&mut self, target: TargetISA) -> &mut Config {
Expand Down Expand Up @@ -531,6 +538,9 @@ impl Config {
if self.instrument {
ispc_args.push(String::from("--instrument"));
}
if self.enable_llvm_intrinsics {
ispc_args.push(String::from("--enable-llvm-intrinsics"));
}
if let Some(ref t) = self.target_isa {
let mut isa_str = String::from("--target=");
isa_str.push_str(&t[0].to_string());
Expand Down
Loading