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

Give the nounwind LLVM attribute to all public APIs #208

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/math/acos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fn r(z: f64) -> f64 {
/// Returns values in radians, in the range of 0 to pi.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn acos(x: f64) -> f64 {
pub extern "C" fn acos(x: f64) -> f64 {
let x1p_120f = f64::from_bits(0x3870000000000000); // 0x1p-120 === 2 ^ -120
let z: f64;
let w: f64;
Expand Down
2 changes: 1 addition & 1 deletion src/math/acosf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fn r(z: f32) -> f32 {
/// Returns values in radians, in the range of 0 to pi.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn acosf(x: f32) -> f32 {
pub extern "C" fn acosf(x: f32) -> f32 {
let x1p_120 = f32::from_bits(0x03800000); // 0x1p-120 === 2 ^ (-120)

let z: f32;
Expand Down
2 changes: 1 addition & 1 deletion src/math/acosh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const LN2: f64 = 0.693147180559945309417232121458176568; /* 0x3fe62e42, 0xfefa3
/// Calculates the inverse hyperbolic cosine of `x`.
/// Is defined as `log(x + sqrt(x*x-1))`.
/// `x` must be a number greater than or equal to 1.
pub fn acosh(x: f64) -> f64 {
pub extern "C" fn acosh(x: f64) -> f64 {
let u = x.to_bits();
let e = ((u >> 52) as usize) & 0x7ff;

Expand Down
2 changes: 1 addition & 1 deletion src/math/acoshf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const LN2: f32 = 0.693147180559945309417232121458176568;
/// Calculates the inverse hyperbolic cosine of `x`.
/// Is defined as `log(x + sqrt(x*x-1))`.
/// `x` must be a number greater than or equal to 1.
pub fn acoshf(x: f32) -> f32 {
pub extern "C" fn acoshf(x: f32) -> f32 {
let u = x.to_bits();
let a = u & 0x7fffffff;

Expand Down
2 changes: 1 addition & 1 deletion src/math/asin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ fn comp_r(z: f64) -> f64 {
/// Returns values in radians, in the range of -pi/2 to pi/2.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn asin(mut x: f64) -> f64 {
pub extern "C" fn asin(mut x: f64) -> f64 {
let z: f64;
let r: f64;
let s: f64;
Expand Down
2 changes: 1 addition & 1 deletion src/math/asinf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fn r(z: f32) -> f32 {
/// Returns values in radians, in the range of -pi/2 to pi/2.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn asinf(mut x: f32) -> f32 {
pub extern "C" fn asinf(mut x: f32) -> f32 {
let x1p_120 = f64::from_bits(0x3870000000000000); // 0x1p-120 === 2 ^ (-120)

let hx = x.to_bits();
Expand Down
2 changes: 1 addition & 1 deletion src/math/asinh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const LN2: f64 = 0.693147180559945309417232121458176568; /* 0x3fe62e42, 0xfefa3
///
/// Calculates the inverse hyperbolic sine of `x`.
/// Is defined as `sgn(x)*log(|x|+sqrt(x*x+1))`.
pub fn asinh(mut x: f64) -> f64 {
pub extern "C" fn asinh(mut x: f64) -> f64 {
let mut u = x.to_bits();
let e = ((u >> 52) as usize) & 0x7ff;
let sign = (u >> 63) != 0;
Expand Down
2 changes: 1 addition & 1 deletion src/math/asinhf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const LN2: f32 = 0.693147180559945309417232121458176568;
///
/// Calculates the inverse hyperbolic sine of `x`.
/// Is defined as `sgn(x)*log(|x|+sqrt(x*x+1))`.
pub fn asinhf(mut x: f32) -> f32 {
pub extern "C" fn asinhf(mut x: f32) -> f32 {
let u = x.to_bits();
let i = u & 0x7fffffff;
let sign = (u >> 31) != 0;
Expand Down
2 changes: 1 addition & 1 deletion src/math/atan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const AT: [f64; 11] = [
/// Returns a value in radians, in the range of -pi/2 to pi/2.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn atan(x: f64) -> f64 {
pub extern "C" fn atan(x: f64) -> f64 {
let mut x = x;
let mut ix = (x.to_bits() >> 32) as u32;
let sign = ix >> 31;
Expand Down
2 changes: 1 addition & 1 deletion src/math/atan2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const PI_LO: f64 = 1.2246467991473531772E-16; /* 0x3CA1A626, 0x33145C07 */
/// Returns a value in radians, in the range of -pi to pi.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn atan2(y: f64, x: f64) -> f64 {
pub extern "C" fn atan2(y: f64, x: f64) -> f64 {
if x.is_nan() || y.is_nan() {
return x + y;
}
Expand Down
2 changes: 1 addition & 1 deletion src/math/atan2f.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const PI_LO: f32 = -8.7422776573e-08; /* 0xb3bbbd2e */
/// Returns a value in radians, in the range of -pi to pi.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn atan2f(y: f32, x: f32) -> f32 {
pub extern "C" fn atan2f(y: f32, x: f32) -> f32 {
if x.is_nan() || y.is_nan() {
return x + y;
}
Expand Down
2 changes: 1 addition & 1 deletion src/math/atanf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const A_T: [f32; 5] = [
/// Returns a value in radians, in the range of -pi/2 to pi/2.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn atanf(mut x: f32) -> f32 {
pub extern "C" fn atanf(mut x: f32) -> f32 {
let x1p_120 = f32::from_bits(0x03800000); // 0x1p-120 === 2 ^ (-120)

let z: f32;
Expand Down
2 changes: 1 addition & 1 deletion src/math/atanh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use super::log1p;
///
/// Calculates the inverse hyperbolic tangent of `x`.
/// Is defined as `log((1+x)/(1-x))/2 = log1p(2x/(1-x))/2`.
pub fn atanh(x: f64) -> f64 {
pub extern "C" fn atanh(x: f64) -> f64 {
let u = x.to_bits();
let e = ((u >> 52) as usize) & 0x7ff;
let sign = (u >> 63) != 0;
Expand Down
2 changes: 1 addition & 1 deletion src/math/atanhf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use super::log1pf;
///
/// Calculates the inverse hyperbolic tangent of `x`.
/// Is defined as `log((1+x)/(1-x))/2 = log1p(2x/(1-x))/2`.
pub fn atanhf(mut x: f32) -> f32 {
pub extern "C" fn atanhf(mut x: f32) -> f32 {
let mut u = x.to_bits();
let sign = (u >> 31) != 0;

Expand Down
2 changes: 1 addition & 1 deletion src/math/cbrt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const P4: f64 = 0.145996192886612446982; /* 0x3fc2b000, 0xd4e4edd7 */
/// Computes the cube root of the argument.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn cbrt(x: f64) -> f64 {
pub extern "C" fn cbrt(x: f64) -> f64 {
let x1p54 = f64::from_bits(0x4350000000000000); // 0x1p54 === 2 ^ 54

let mut ui: u64 = x.to_bits();
Expand Down
2 changes: 1 addition & 1 deletion src/math/cbrtf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const B2: u32 = 642849266; /* B2 = (127-127.0/3-24/3-0.03306235651)*2**23 */
/// Computes the cube root of the argument.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn cbrtf(x: f32) -> f32 {
pub extern "C" fn cbrtf(x: f32) -> f32 {
let x1p24 = f32::from_bits(0x4b800000); // 0x1p24f === 2 ^ 24

let mut r: f64;
Expand Down
2 changes: 1 addition & 1 deletion src/math/ceil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const TOINT: f64 = 1. / f64::EPSILON;
/// Finds the nearest integer greater than or equal to `x`.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn ceil(x: f64) -> f64 {
pub extern "C" fn ceil(x: f64) -> f64 {
// On wasm32 we know that LLVM's intrinsic will compile to an optimized
// `f64.ceil` native instruction, so we can leverage this for both code size
// and speed.
Expand Down
2 changes: 1 addition & 1 deletion src/math/ceilf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use core::f32;
/// Finds the nearest integer greater than or equal to `x`.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn ceilf(x: f32) -> f32 {
pub extern "C" fn ceilf(x: f32) -> f32 {
// On wasm32 we know that LLVM's intrinsic will compile to an optimized
// `f32.ceil` native instruction, so we can leverage this for both code size
// and speed.
Expand Down
2 changes: 1 addition & 1 deletion src/math/copysign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
///
/// Constructs a number with the magnitude (absolute value) of its
/// first argument, `x`, and the sign of its second argument, `y`.
pub fn copysign(x: f64, y: f64) -> f64 {
pub extern "C" fn copysign(x: f64, y: f64) -> f64 {
let mut ux = x.to_bits();
let uy = y.to_bits();
ux &= (!0) >> 1;
Expand Down
2 changes: 1 addition & 1 deletion src/math/copysignf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
///
/// Constructs a number with the magnitude (absolute value) of its
/// first argument, `x`, and the sign of its second argument, `y`.
pub fn copysignf(x: f32, y: f32) -> f32 {
pub extern "C" fn copysignf(x: f32, y: f32) -> f32 {
let mut ux = x.to_bits();
let uy = y.to_bits();
ux &= 0x7fffffff;
Expand Down
2 changes: 1 addition & 1 deletion src/math/cos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use super::{k_cos, k_sin, rem_pio2};
//
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn cos(x: f64) -> f64 {
pub extern "C" fn cos(x: f64) -> f64 {
let ix = (f64::to_bits(x) >> 32) as u32 & 0x7fffffff;

/* |x| ~< pi/4 */
Expand Down
2 changes: 1 addition & 1 deletion src/math/cosf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const C4_PIO2: f64 = 4. * FRAC_PI_2; /* 0x401921FB, 0x54442D18 */

#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn cosf(x: f32) -> f32 {
pub extern "C" fn cosf(x: f32) -> f32 {
let x64 = x as f64;

let x1p120 = f32::from_bits(0x7b800000); // 0x1p120f === 2 ^ 120
Expand Down
2 changes: 1 addition & 1 deletion src/math/cosh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use super::k_expo2;
/// Angles are specified in radians.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn cosh(mut x: f64) -> f64 {
pub extern "C" fn cosh(mut x: f64) -> f64 {
/* |x| */
let mut ix = x.to_bits();
ix &= 0x7fffffffffffffff;
Expand Down
2 changes: 1 addition & 1 deletion src/math/coshf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use super::k_expo2f;
/// Angles are specified in radians.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn coshf(mut x: f32) -> f32 {
pub extern "C" fn coshf(mut x: f32) -> f32 {
let x1p120 = f32::from_bits(0x7b800000); // 0x1p120f === 2 ^ 120

/* |x| */
Expand Down
4 changes: 2 additions & 2 deletions src/math/erf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ fn erfc2(ix: u32, mut x: f64) -> f64 {
/// Calculates an approximation to the “error function”, which estimates
/// the probability that an observation will fall within x standard
/// deviations of the mean (assuming a normal distribution).
pub fn erf(x: f64) -> f64 {
pub extern "C" fn erf(x: f64) -> f64 {
let r: f64;
let s: f64;
let z: f64;
Expand Down Expand Up @@ -268,7 +268,7 @@ pub fn erf(x: f64) -> f64 {
/// Is `1 - erf(x)`. Is computed directly, so that you can use it to avoid
/// the loss of precision that would result from subtracting
/// large probabilities (on large `x`) from 1.
pub fn erfc(x: f64) -> f64 {
pub extern "C" fn erfc(x: f64) -> f64 {
let r: f64;
let s: f64;
let z: f64;
Expand Down
4 changes: 2 additions & 2 deletions src/math/erff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ fn erfc2(mut ix: u32, mut x: f32) -> f32 {
/// Calculates an approximation to the “error function”, which estimates
/// the probability that an observation will fall within x standard
/// deviations of the mean (assuming a normal distribution).
pub fn erff(x: f32) -> f32 {
pub extern "C" fn erff(x: f32) -> f32 {
let r: f32;
let s: f32;
let z: f32;
Expand Down Expand Up @@ -179,7 +179,7 @@ pub fn erff(x: f32) -> f32 {
/// Is `1 - erf(x)`. Is computed directly, so that you can use it to avoid
/// the loss of precision that would result from subtracting
/// large probabilities (on large `x`) from 1.
pub fn erfcf(x: f32) -> f32 {
pub extern "C" fn erfcf(x: f32) -> f32 {
let r: f32;
let s: f32;
let z: f32;
Expand Down
2 changes: 1 addition & 1 deletion src/math/exp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const P5: f64 = 4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */
/// (where *e* is the base of the natural system of logarithms, approximately 2.71828).
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn exp(mut x: f64) -> f64 {
pub extern "C" fn exp(mut x: f64) -> f64 {
let x1p1023 = f64::from_bits(0x7fe0000000000000); // 0x1p1023 === 2 ^ 1023
let x1p_149 = f64::from_bits(0x36a0000000000000); // 0x1p-149 === 2 ^ -149

Expand Down
2 changes: 1 addition & 1 deletion src/math/exp10.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const P10: &[f64] = &[
1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15,
];

pub fn exp10(x: f64) -> f64 {
pub extern "C" fn exp10(x: f64) -> f64 {
let (mut y, n) = modf(x);
let u: u64 = n.to_bits();
/* fabs(n) < 16 without raising invalid on nan */
Expand Down
2 changes: 1 addition & 1 deletion src/math/exp10f.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const P10: &[f32] = &[
1e-7, 1e-6, 1e-5, 1e-4, 1e-3, 1e-2, 1e-1, 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7,
];

pub fn exp10f(x: f32) -> f32 {
pub extern "C" fn exp10f(x: f32) -> f32 {
let (mut y, n) = modff(x);
let u = n.to_bits();
/* fabsf(n) < 8 without raising invalid on nan */
Expand Down
2 changes: 1 addition & 1 deletion src/math/exp2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ static TBL: [u64; TBLSIZE * 2] = [
/// Calculate `2^x`, that is, 2 raised to the power `x`.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn exp2(mut x: f64) -> f64 {
pub extern "C" fn exp2(mut x: f64) -> f64 {
let redux = f64::from_bits(0x4338000000000000) / TBLSIZE as f64;
let p1 = f64::from_bits(0x3fe62e42fefa39ef);
let p2 = f64::from_bits(0x3fcebfbdff82c575);
Expand Down
2 changes: 1 addition & 1 deletion src/math/exp2f.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static EXP2FT: [u64; TBLSIZE] = [
/// Calculate `2^x`, that is, 2 raised to the power `x`.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn exp2f(mut x: f32) -> f32 {
pub extern "C" fn exp2f(mut x: f32) -> f32 {
let redux = f32::from_bits(0x4b400000) / TBLSIZE as f32;
let p1 = f32::from_bits(0x3f317218);
let p2 = f32::from_bits(0x3e75fdf0);
Expand Down
2 changes: 1 addition & 1 deletion src/math/expf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const P2: f32 = -2.7667332906e-3; /* -0xb55215.0p-32 */
/// (where *e* is the base of the natural system of logarithms, approximately 2.71828).
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn expf(mut x: f32) -> f32 {
pub extern "C" fn expf(mut x: f32) -> f32 {
let x1p127 = f32::from_bits(0x7f000000); // 0x1p127f === 2 ^ 127
let x1p_126 = f32::from_bits(0x800000); // 0x1p-126f === 2 ^ -126 /*original 0x1p-149f ??????????? */
let mut hx = x.to_bits();
Expand Down
2 changes: 1 addition & 1 deletion src/math/expm1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const Q5: f64 = -2.01099218183624371326e-07; /* BE8AFDB7 6E09C32D */
/// where using `exp(x)-1` would lose many significant digits.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn expm1(mut x: f64) -> f64 {
pub extern "C" fn expm1(mut x: f64) -> f64 {
let hi: f64;
let lo: f64;
let k: i32;
Expand Down
2 changes: 1 addition & 1 deletion src/math/expm1f.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const Q2: f32 = 1.5807170421e-3; /* 0xcf3010.0p-33 */
/// where using `exp(x)-1` would lose many significant digits.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn expm1f(mut x: f32) -> f32 {
pub extern "C" fn expm1f(mut x: f32) -> f32 {
let x1p127 = f32::from_bits(0x7f000000); // 0x1p127f === 2 ^ 127

let mut hx = x.to_bits();
Expand Down
2 changes: 1 addition & 1 deletion src/math/fabs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use core::u64;
/// by direct manipulation of the bit representation of `x`.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn fabs(x: f64) -> f64 {
pub extern "C" fn fabs(x: f64) -> f64 {
// On wasm32 we know that LLVM's intrinsic will compile to an optimized
// `f64.abs` native instruction, so we can leverage this for both code size
// and speed.
Expand Down
2 changes: 1 addition & 1 deletion src/math/fabsf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// by direct manipulation of the bit representation of `x`.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn fabsf(x: f32) -> f32 {
pub extern "C" fn fabsf(x: f32) -> f32 {
// On wasm32 we know that LLVM's intrinsic will compile to an optimized
// `f32.abs` native instruction, so we can leverage this for both code size
// and speed.
Expand Down
2 changes: 1 addition & 1 deletion src/math/fdim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use core::f64;
/// A range error may occur.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn fdim(x: f64, y: f64) -> f64 {
pub extern "C" fn fdim(x: f64, y: f64) -> f64 {
if x.is_nan() {
x
} else if y.is_nan() {
Expand Down
2 changes: 1 addition & 1 deletion src/math/fdimf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use core::f32;
/// A range error may occur.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn fdimf(x: f32, y: f32) -> f32 {
pub extern "C" fn fdimf(x: f32, y: f32) -> f32 {
if x.is_nan() {
x
} else if y.is_nan() {
Expand Down
2 changes: 1 addition & 1 deletion src/math/floor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const TOINT: f64 = 1. / f64::EPSILON;
/// Finds the nearest integer less than or equal to `x`.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn floor(x: f64) -> f64 {
pub extern "C" fn floor(x: f64) -> f64 {
// On wasm32 we know that LLVM's intrinsic will compile to an optimized
// `f64.floor` native instruction, so we can leverage this for both code size
// and speed.
Expand Down
2 changes: 1 addition & 1 deletion src/math/floorf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use core::f32;
/// Finds the nearest integer less than or equal to `x`.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn floorf(x: f32) -> f32 {
pub extern "C" fn floorf(x: f32) -> f32 {
// On wasm32 we know that LLVM's intrinsic will compile to an optimized
// `f32.floor` native instruction, so we can leverage this for both code size
// and speed.
Expand Down
2 changes: 1 addition & 1 deletion src/math/fma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fn mul(x: u64, y: u64) -> (u64, u64) {
/// according to the rounding mode characterized by the value of FLT_ROUNDS.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn fma(x: f64, y: f64, z: f64) -> f64 {
pub extern "C" fn fma(x: f64, y: f64, z: f64) -> f64 {
let x1p63: f64 = f64::from_bits(0x43e0000000000000); // 0x1p63 === 2 ^ 63
let x0_ffffff8p_63 = f64::from_bits(0x3bfffffff0000000); // 0x0.ffffff8p-63

Expand Down
2 changes: 1 addition & 1 deletion src/math/fmaf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ use super::fenv::{
/// according to the rounding mode characterized by the value of FLT_ROUNDS.
#[inline]
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn fmaf(x: f32, y: f32, mut z: f32) -> f32 {
pub extern "C" fn fmaf(x: f32, y: f32, mut z: f32) -> f32 {
let xy: f64;
let mut result: f64;
let mut ui: u64;
Expand Down
Loading