From 4012b9c4f514f8e15cf849d351fb202a66bb024e Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 2 May 2019 12:40:39 -0700 Subject: [PATCH] Include `ldexp*` intrinsics on the wasm target Looks like LLVM optimizes programs like: fn foo(a: u8) -> f32 { 2.0f32.powf(a as f32) } to actually invoking `ldexpf`, so let's be sure to include bindings so there's not undefined symbols. --- libm | 2 +- src/math.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libm b/libm index 3559e70..0ae4428 160000 --- a/libm +++ b/libm @@ -1 +1 @@ -Subproject commit 3559e703795d33e84a91da2a35f2f3baac47e872 +Subproject commit 0ae442888c7af72c0a335edd43dbbd74c751f119 diff --git a/src/math.rs b/src/math.rs index b619555..1893f1c 100644 --- a/src/math.rs +++ b/src/math.rs @@ -71,6 +71,8 @@ no_mangle! { fn sinhf(n: f32) -> f32; fn tanf(n: f32) -> f32; fn tanhf(n: f32) -> f32; + fn ldexp(f: f64, n: i32) -> f64; + fn ldexpf(f: f32, n: i32) -> f32; } #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))]