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

Commit a0a5bd8

Browse files
committed
Remove most #[inline] annotations
These annotations fall into a few categories * Some simply aren't needed since functions will always be in the same CGU anyway and are already candidates for inlining. * Many are on massive functions which shouldn't be inlined across crates due to code size concerns. * Others aren't necessary since calls to this crate are rarely inlined anyway (since it's lowered through LLVM). If this crate is called directly and inlining is needed then LTO can always be turned on, otherwise this will benefit downstream consumers by avoiding re-codegen'ing so many functions.
1 parent 3a59e93 commit a0a5bd8

Some content is hidden

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

84 files changed

+2
-91
lines changed

src/math/acos.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ const QS2: f64 = 2.02094576023350569471e+00; /* 0x40002AE5, 0x9C598AC8 */
4848
const QS3: f64 = -6.88283971605453293030e-01; /* 0xBFE6066C, 0x1B8D0159 */
4949
const QS4: f64 = 7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */
5050

51-
#[inline]
5251
fn r(z: f64) -> f64 {
5352
let p: f64 = z * (PS0 + z * (PS1 + z * (PS2 + z * (PS3 + z * (PS4 + z * PS5)))));
5453
let q: f64 = 1.0 + z * (QS1 + z * (QS2 + z * (QS3 + z * QS4)));
@@ -60,7 +59,6 @@ fn r(z: f64) -> f64 {
6059
/// Computes the inverse cosine (arc cosine) of the input value.
6160
/// Arguments must be in the range -1 to 1.
6261
/// Returns values in radians, in the range of 0 to pi.
63-
#[inline]
6462
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
6563
pub fn acos(x: f64) -> f64 {
6664
let x1p_120f = f64::from_bits(0x3870000000000000); // 0x1p-120 === 2 ^ -120

src/math/acosf.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const P_S1: f32 = -4.2743422091e-02;
2222
const P_S2: f32 = -8.6563630030e-03;
2323
const Q_S1: f32 = -7.0662963390e-01;
2424

25-
#[inline]
2625
fn r(z: f32) -> f32 {
2726
let p = z * (P_S0 + z * (P_S1 + z * P_S2));
2827
let q = 1. + z * Q_S1;
@@ -34,7 +33,6 @@ fn r(z: f32) -> f32 {
3433
/// Computes the inverse cosine (arc cosine) of the input value.
3534
/// Arguments must be in the range -1 to 1.
3635
/// Returns values in radians, in the range of 0 to pi.
37-
#[inline]
3836
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
3937
pub fn acosf(x: f32) -> f32 {
4038
let x1p_120 = f32::from_bits(0x03800000); // 0x1p-120 === 2 ^ (-120)

src/math/asin.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ const Q_S2: f64 = 2.02094576023350569471e+00; /* 0x40002AE5, 0x9C598AC8 */
5555
const Q_S3: f64 = -6.88283971605453293030e-01; /* 0xBFE6066C, 0x1B8D0159 */
5656
const Q_S4: f64 = 7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */
5757

58-
#[inline]
5958
fn comp_r(z: f64) -> f64 {
6059
let p = z * (P_S0 + z * (P_S1 + z * (P_S2 + z * (P_S3 + z * (P_S4 + z * P_S5)))));
6160
let q = 1.0 + z * (Q_S1 + z * (Q_S2 + z * (Q_S3 + z * Q_S4)));
@@ -67,7 +66,6 @@ fn comp_r(z: f64) -> f64 {
6766
/// Computes the inverse sine (arc sine) of the argument `x`.
6867
/// Arguments to asin must be in the range -1 to 1.
6968
/// Returns values in radians, in the range of -pi/2 to pi/2.
70-
#[inline]
7169
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
7270
pub fn asin(mut x: f64) -> f64 {
7371
let z: f64;

src/math/asinf.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ const P_S1: f32 = -4.2743422091e-02;
2424
const P_S2: f32 = -8.6563630030e-03;
2525
const Q_S1: f32 = -7.0662963390e-01;
2626

27-
#[inline]
2827
fn r(z: f32) -> f32 {
2928
let p = z * (P_S0 + z * (P_S1 + z * P_S2));
3029
let q = 1. + z * Q_S1;
@@ -36,7 +35,6 @@ fn r(z: f32) -> f32 {
3635
/// Computes the inverse sine (arc sine) of the argument `x`.
3736
/// Arguments to asin must be in the range -1 to 1.
3837
/// Returns values in radians, in the range of -pi/2 to pi/2.
39-
#[inline]
4038
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
4139
pub fn asinf(mut x: f32) -> f32 {
4240
let x1p_120 = f64::from_bits(0x3870000000000000); // 0x1p-120 === 2 ^ (-120)

src/math/atan.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ const AT: [f64; 11] = [
6464
///
6565
/// Computes the inverse tangent (arc tangent) of the input value.
6666
/// Returns a value in radians, in the range of -pi/2 to pi/2.
67-
#[inline]
6867
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
6968
pub fn atan(x: f64) -> f64 {
7069
let mut x = x;

src/math/atan2.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ const PI_LO: f64 = 1.2246467991473531772E-16; /* 0x3CA1A626, 0x33145C07 */
4848
/// Computes the inverse tangent (arc tangent) of `y/x`.
4949
/// Produces the correct result even for angles near pi/2 or -pi/2 (that is, when `x` is near 0).
5050
/// Returns a value in radians, in the range of -pi to pi.
51-
#[inline]
5251
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
5352
pub fn atan2(y: f64, x: f64) -> f64 {
5453
if x.is_nan() || y.is_nan() {

src/math/atan2f.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ const PI_LO: f32 = -8.7422776573e-08; /* 0xb3bbbd2e */
2424
/// Computes the inverse tangent (arc tangent) of `y/x`.
2525
/// Produces the correct result even for angles near pi/2 or -pi/2 (that is, when `x` is near 0).
2626
/// Returns a value in radians, in the range of -pi to pi.
27-
#[inline]
2827
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
2928
pub fn atan2f(y: f32, x: f32) -> f32 {
3029
if x.is_nan() || y.is_nan() {

src/math/atanf.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ const A_T: [f32; 5] = [
4141
///
4242
/// Computes the inverse tangent (arc tangent) of the input value.
4343
/// Returns a value in radians, in the range of -pi/2 to pi/2.
44-
#[inline]
4544
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
4645
pub fn atanf(mut x: f32) -> f32 {
4746
let x1p_120 = f32::from_bits(0x03800000); // 0x1p-120 === 2 ^ (-120)

src/math/cbrt.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ const P4: f64 = 0.145996192886612446982; /* 0x3fc2b000, 0xd4e4edd7 */
3030
// Cube root (f64)
3131
///
3232
/// Computes the cube root of the argument.
33-
#[inline]
3433
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
3534
pub fn cbrt(x: f64) -> f64 {
3635
let x1p54 = f64::from_bits(0x4350000000000000); // 0x1p54 === 2 ^ 54

src/math/cbrtf.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const B2: u32 = 642849266; /* B2 = (127-127.0/3-24/3-0.03306235651)*2**23 */
2525
/// Cube root (f32)
2626
///
2727
/// Computes the cube root of the argument.
28-
#[inline]
2928
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
3029
pub fn cbrtf(x: f32) -> f32 {
3130
let x1p24 = f32::from_bits(0x4b800000); // 0x1p24f === 2 ^ 24

0 commit comments

Comments
 (0)