math: compile math functions for Xous

This adds support for Xous, enabling users to call math functions on
primitives such as `cos()`.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross
2021-09-09 11:21:33 +08:00
parent bb0b7d660f
commit 7cdad114a5
2 changed files with 13 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ macro_rules! no_mangle {
target_os = "unknown",
not(target_env = "wasi")
),
target_os = "xous",
all(target_arch = "x86_64", target_os = "uefi"),
all(target_arch = "xtensa", target_os = "none"),
all(target_vendor = "fortanix", target_env = "sgx")
@@ -70,6 +71,7 @@ no_mangle! {
target_os = "unknown",
not(target_env = "wasi")
),
target_os = "xous",
all(target_arch = "xtensa", target_os = "none"),
all(target_vendor = "fortanix", target_env = "sgx")
))]
@@ -93,7 +95,16 @@ no_mangle! {
fn tanf(n: f32) -> f32;
}
#[cfg(all(target_vendor = "fortanix", target_env = "sgx"))]
#[cfg(target_os = "xous")]
no_mangle! {
fn sqrtf(x: f32) -> f32;
fn sqrt(x: f64) -> f64;
}
#[cfg(any(
all(target_vendor = "fortanix", target_env = "sgx"),
target_os = "xous"
))]
no_mangle! {
fn ceil(x: f64) -> f64;
fn ceilf(x: f32) -> f32;