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

Commit 63ec2ef

Browse files
committed
Add missing inline and nopanic attributes
1 parent 8c06185 commit 63ec2ef

24 files changed

+60
-2
lines changed

crates/libm/src/math/exp10.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ const P10: &[f64] = &[
66
1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15,
77
];
88

9+
#[inline]
10+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
911
pub fn exp10(x: f64) -> f64 {
1012
let (mut y, n) = modf(x);
1113
let u: u64 = n.to_bits();

crates/libm/src/math/exp10f.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ const P10: &[f32] = &[
66
1e-7, 1e-6, 1e-5, 1e-4, 1e-3, 1e-2, 1e-1, 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7,
77
];
88

9+
#[inline]
10+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
911
pub fn exp10f(x: f32) -> f32 {
1012
let (mut y, n) = modff(x);
1113
let u = n.to_bits();

crates/libm/src/math/frexp.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#[inline]
2+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
13
pub fn frexp(x: f64) -> (f64, i32) {
24
let mut y = x.to_bits();
35
let ee = ((y >> 52) & 0x7ff) as i32;

crates/libm/src/math/frexpf.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#[inline]
2+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
13
pub fn frexpf(x: f32) -> (f32, i32) {
24
let mut y = x.to_bits();
35
let ee: i32 = ((y >> 23) & 0xff) as i32;

crates/libm/src/math/ilogb.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
const FP_ILOGBNAN: i32 = -1 - 0x7fffffff;
22
const FP_ILOGB0: i32 = FP_ILOGBNAN;
33

4+
#[inline]
5+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
46
pub fn ilogb(x: f64) -> i32 {
57
let mut i: u64 = x.to_bits();
68
let e = ((i >> 52) & 0x7ff) as i32;

crates/libm/src/math/ilogbf.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
const FP_ILOGBNAN: i32 = -1 - 0x7fffffff;
22
const FP_ILOGB0: i32 = FP_ILOGBNAN;
33

4+
#[inline]
5+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
46
pub fn ilogbf(x: f32) -> i32 {
57
let mut i = x.to_bits();
68
let e = ((i >> 23) & 0xff) as i32;

crates/libm/src/math/j0.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ const S02: f64 = 1.16926784663337450260e-04; /* 0x3F1EA6D2, 0xDD57DBF4 */
109109
const S03: f64 = 5.13546550207318111446e-07; /* 0x3EA13B54, 0xCE84D5A9 */
110110
const S04: f64 = 1.16614003333790000205e-09; /* 0x3E1408BC, 0xF4745D8F */
111111

112+
#[inline]
113+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
112114
pub fn j0(mut x: f64) -> f64 {
113115
let z: f64;
114116
let r: f64;
@@ -162,6 +164,8 @@ const V02: f64 = 7.60068627350353253702e-05; /* 0x3F13ECBB, 0xF578C6C1 */
162164
const V03: f64 = 2.59150851840457805467e-07; /* 0x3E91642D, 0x7FF202FD */
163165
const V04: f64 = 4.41110311332675467403e-10; /* 0x3DFE5018, 0x3BD6D9EF */
164166

167+
#[inline]
168+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
165169
pub fn y0(x: f64) -> f64 {
166170
let z: f64;
167171
let u: f64;

crates/libm/src/math/j0f.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ const S02: f32 = 1.1692678527e-04; /* 0x38f53697 */
6262
const S03: f32 = 5.1354652442e-07; /* 0x3509daa6 */
6363
const S04: f32 = 1.1661400734e-09; /* 0x30a045e8 */
6464

65+
#[inline]
66+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
6567
pub fn j0f(mut x: f32) -> f32 {
6668
let z: f32;
6769
let r: f32;
@@ -106,7 +108,8 @@ const V01: f32 = 1.2730483897e-02; /* 0x3c509385 */
106108
const V02: f32 = 7.6006865129e-05; /* 0x389f65e0 */
107109
const V03: f32 = 2.5915085189e-07; /* 0x348b216c */
108110
const V04: f32 = 4.4111031494e-10; /* 0x2ff280c2 */
109-
111+
#[inline]
112+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
110113
pub fn y0f(x: f32) -> f32 {
111114
let z: f32;
112115
let u: f32;

crates/libm/src/math/j1.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ const S03: f64 = 1.17718464042623683263e-06; /* 0x3EB3BFF8, 0x333F8498 */
113113
const S04: f64 = 5.04636257076217042715e-09; /* 0x3E35AC88, 0xC97DFF2C */
114114
const S05: f64 = 1.23542274426137913908e-11; /* 0x3DAB2ACF, 0xCFB97ED8 */
115115

116+
#[inline]
117+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
116118
pub fn j1(x: f64) -> f64 {
117119
let mut z: f64;
118120
let r: f64;
@@ -158,6 +160,8 @@ const V0: [f64; 5] = [
158160
1.66559246207992079114e-11, /* 0x3DB25039, 0xDACA772A */
159161
];
160162

163+
#[inline]
164+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
161165
pub fn y1(x: f64) -> f64 {
162166
let z: f64;
163167
let u: f64;

crates/libm/src/math/j1f.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ const S03: f32 = 1.1771846857e-06; /* 0x359dffc2 */
6363
const S04: f32 = 5.0463624390e-09; /* 0x31ad6446 */
6464
const S05: f32 = 1.2354227016e-11; /* 0x2d59567e */
6565

66+
#[inline]
67+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
6668
pub fn j1f(x: f32) -> f32 {
6769
let mut z: f32;
6870
let r: f32;
@@ -107,6 +109,8 @@ const V0: [f32; 5] = [
107109
1.6655924903e-11, /* 0x2d9281cf */
108110
];
109111

112+
#[inline]
113+
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
110114
pub fn y1f(x: f32) -> f32 {
111115
let z: f32;
112116
let u: f32;

0 commit comments

Comments
 (0)