summaryrefslogtreecommitdiffstats
path: root/vendor/compiler_builtins/src/math.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
commit1376c5a617be5c25655d0d7cb63e3beaa5a6e026 (patch)
tree3bb8d61aee02bc7a15eab3f36e3b921afc2075d0 /vendor/compiler_builtins/src/math.rs
parentReleasing progress-linux version 1.69.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.tar.xz
rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/compiler_builtins/src/math.rs')
-rw-r--r--vendor/compiler_builtins/src/math.rs32
1 files changed, 31 insertions, 1 deletions
diff --git a/vendor/compiler_builtins/src/math.rs b/vendor/compiler_builtins/src/math.rs
index c64984e9e..498e4d85f 100644
--- a/vendor/compiler_builtins/src/math.rs
+++ b/vendor/compiler_builtins/src/math.rs
@@ -86,7 +86,36 @@ no_mangle! {
fn tanf(n: f32) -> f32;
}
-#[cfg(any(target_os = "xous", target_os = "uefi"))]
+#[cfg(any(
+ all(
+ target_family = "wasm",
+ 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")
+))]
+intrinsics! {
+ pub extern "C" fn lgamma_r(x: f64, s: &mut i32) -> f64 {
+ let r = self::libm::lgamma_r(x);
+ *s = r.1;
+ r.0
+ }
+
+ pub extern "C" fn lgammaf_r(x: f32, s: &mut i32) -> f32 {
+ let r = self::libm::lgammaf_r(x);
+ *s = r.1;
+ r.0
+ }
+}
+
+#[cfg(any(
+ target_os = "xous",
+ target_os = "uefi",
+ all(target_arch = "xtensa", target_os = "none"),
+))]
no_mangle! {
fn sqrtf(x: f32) -> f32;
fn sqrt(x: f64) -> f64;
@@ -94,6 +123,7 @@ no_mangle! {
#[cfg(any(
all(target_vendor = "fortanix", target_env = "sgx"),
+ all(target_arch = "xtensa", target_os = "none"),
target_os = "xous",
target_os = "uefi"
))]