Skip to content

Commit 0a3d5c0

Browse files
committed
Update the libm submodule
This requires privately reexporting `libm`'s `support` module at crate root, where it is expected for macros. Once `libm` is made always available, the reexport can be simplified. This delta adds a lot of routines to `f16` and `f128`: * ceil * floor * fma (f128 only) * fmax * fmin * fmod * ldexp * rint * round * scalbn * sqrt Additionally, the following new API was added for all four float types: * fmaximum * fmaximum_num * fminimum * fminimum_num * roundeven There are also some significant performance improvements for `sqrt` and `sqrtf`, as well as precision improvements for `cbrt` (both `f32` and `f64` versions of this function are now always correctly rounded).
1 parent 238b055 commit 0a3d5c0

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

libm

Submodule libm updated 136 files

src/lib.rs

+15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![cfg_attr(feature = "compiler-builtins", compiler_builtins)]
2+
#![cfg_attr(all(target_family = "wasm"), feature(wasm_numeric_instr))]
23
#![feature(abi_unadjusted)]
34
#![feature(asm_experimental_arch)]
45
#![feature(cfg_target_has_atomic)]
@@ -58,6 +59,20 @@ pub mod int;
5859
all(target_family = "wasm", not(target_os = "unknown"))
5960
)))]
6061
pub mod math;
62+
63+
// `libm` expects its `support` module to be available in the crate root. This config can be
64+
// cleaned up once `libm` is made always available.
65+
#[cfg(not(any(
66+
all(
67+
target_arch = "x86",
68+
not(target_feature = "sse2"),
69+
not(target_os = "uefi"),
70+
),
71+
unix,
72+
all(target_family = "wasm", not(target_os = "unknown"))
73+
)))]
74+
use math::libm::support;
75+
6176
pub mod mem;
6277

6378
#[cfg(target_arch = "arm")]

src/math.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#[allow(unused_imports)]
44
#[allow(clippy::all)]
55
#[path = "../libm/src/math/mod.rs"]
6-
mod libm;
6+
pub(crate) mod libm;
77

88
#[allow(unused_macros)]
99
macro_rules! no_mangle {

0 commit comments

Comments
 (0)