Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 1ad29ac

Browse files
committed
Give the LLVM attribute to all public APIs
1 parent 3a59e93 commit 1ad29ac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+112
-112
lines changed

src/math/acos.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fn r(z: f64) -> f64 {
6262
/// Returns values in radians, in the range of 0 to pi.
6363
#[inline]
6464
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
65-
pub fn acos(x: f64) -> f64 {
65+
pub extern "C" fn acos(x: f64) -> f64 {
6666
let x1p_120f = f64::from_bits(0x3870000000000000); // 0x1p-120 === 2 ^ -120
6767
let z: f64;
6868
let w: f64;

src/math/acosf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fn r(z: f32) -> f32 {
3636
/// Returns values in radians, in the range of 0 to pi.
3737
#[inline]
3838
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
39-
pub fn acosf(x: f32) -> f32 {
39+
pub extern "C" fn acosf(x: f32) -> f32 {
4040
let x1p_120 = f32::from_bits(0x03800000); // 0x1p-120 === 2 ^ (-120)
4141

4242
let z: f32;

src/math/acosh.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const LN2: f64 = 0.693147180559945309417232121458176568; /* 0x3fe62e42, 0xfefa3
77
/// Calculates the inverse hyperbolic cosine of `x`.
88
/// Is defined as `log(x + sqrt(x*x-1))`.
99
/// `x` must be a number greater than or equal to 1.
10-
pub fn acosh(x: f64) -> f64 {
10+
pub extern "C" fn acosh(x: f64) -> f64 {
1111
let u = x.to_bits();
1212
let e = ((u >> 52) as usize) & 0x7ff;
1313

src/math/acoshf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const LN2: f32 = 0.693147180559945309417232121458176568;
77
/// Calculates the inverse hyperbolic cosine of `x`.
88
/// Is defined as `log(x + sqrt(x*x-1))`.
99
/// `x` must be a number greater than or equal to 1.
10-
pub fn acoshf(x: f32) -> f32 {
10+
pub extern "C" fn acoshf(x: f32) -> f32 {
1111
let u = x.to_bits();
1212
let a = u & 0x7fffffff;
1313

src/math/asin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ fn comp_r(z: f64) -> f64 {
6969
/// Returns values in radians, in the range of -pi/2 to pi/2.
7070
#[inline]
7171
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
72-
pub fn asin(mut x: f64) -> f64 {
72+
pub extern "C" fn asin(mut x: f64) -> f64 {
7373
let z: f64;
7474
let r: f64;
7575
let s: f64;

src/math/asinf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn r(z: f32) -> f32 {
3838
/// Returns values in radians, in the range of -pi/2 to pi/2.
3939
#[inline]
4040
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
41-
pub fn asinf(mut x: f32) -> f32 {
41+
pub extern "C" fn asinf(mut x: f32) -> f32 {
4242
let x1p_120 = f64::from_bits(0x3870000000000000); // 0x1p-120 === 2 ^ (-120)
4343

4444
let hx = x.to_bits();

src/math/asinh.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const LN2: f64 = 0.693147180559945309417232121458176568; /* 0x3fe62e42, 0xfefa3
77
///
88
/// Calculates the inverse hyperbolic sine of `x`.
99
/// Is defined as `sgn(x)*log(|x|+sqrt(x*x+1))`.
10-
pub fn asinh(mut x: f64) -> f64 {
10+
pub extern "C" fn asinh(mut x: f64) -> f64 {
1111
let mut u = x.to_bits();
1212
let e = ((u >> 52) as usize) & 0x7ff;
1313
let sign = (u >> 63) != 0;

src/math/asinhf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const LN2: f32 = 0.693147180559945309417232121458176568;
77
///
88
/// Calculates the inverse hyperbolic sine of `x`.
99
/// Is defined as `sgn(x)*log(|x|+sqrt(x*x+1))`.
10-
pub fn asinhf(mut x: f32) -> f32 {
10+
pub extern "C" fn asinhf(mut x: f32) -> f32 {
1111
let u = x.to_bits();
1212
let i = u & 0x7fffffff;
1313
let sign = (u >> 31) != 0;

src/math/atan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const AT: [f64; 11] = [
6666
/// Returns a value in radians, in the range of -pi/2 to pi/2.
6767
#[inline]
6868
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
69-
pub fn atan(x: f64) -> f64 {
69+
pub extern "C" fn atan(x: f64) -> f64 {
7070
let mut x = x;
7171
let mut ix = (x.to_bits() >> 32) as u32;
7272
let sign = ix >> 31;

src/math/atan2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const PI_LO: f64 = 1.2246467991473531772E-16; /* 0x3CA1A626, 0x33145C07 */
5050
/// Returns a value in radians, in the range of -pi to pi.
5151
#[inline]
5252
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
53-
pub fn atan2(y: f64, x: f64) -> f64 {
53+
pub extern "C" fn atan2(y: f64, x: f64) -> f64 {
5454
if x.is_nan() || y.is_nan() {
5555
return x + y;
5656
}

0 commit comments

Comments
 (0)