Skip to content

Commit

Permalink
Remove gating on target architecture in math.rs
Browse files Browse the repository at this point in the history
Provide math builtins for every "none" target instead of gating on specific
architectures, with exception being soft floating point functions to
avoid double declarations
  • Loading branch information
mchodzikiewicz committed Oct 31, 2023
1 parent ce1e4d2 commit 06a46b7
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/math.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ macro_rules! no_mangle {
),
target_os = "xous",
target_os = "uefi",
all(target_arch = "xtensa", target_os = "none"),
target_os = "none",
all(target_vendor = "fortanix", target_env = "sgx")
))]
no_mangle! {
Expand Down Expand Up @@ -95,7 +95,7 @@ no_mangle! {
),
target_os = "xous",
target_os = "uefi",
all(target_arch = "xtensa", target_os = "none"),
target_os = "none",
all(target_vendor = "fortanix", target_env = "sgx"),
target_os = "windows"
))]
Expand All @@ -113,19 +113,15 @@ intrinsics! {
}
}

#[cfg(any(
target_os = "xous",
target_os = "uefi",
all(target_arch = "xtensa", target_os = "none"),
))]
#[cfg(any(target_os = "xous", target_os = "uefi", target_os = "none",))]
no_mangle! {
fn sqrtf(x: f32) -> f32;
fn sqrt(x: f64) -> f64;
}

#[cfg(any(
all(target_vendor = "fortanix", target_env = "sgx"),
all(target_arch = "xtensa", target_os = "none"),
target_os = "none",
target_os = "xous",
target_os = "uefi"
))]
Expand Down

0 comments on commit 06a46b7

Please sign in to comment.