Skip to content

Commit 088086a

Browse files
committed
Auto merge of rust-lang#138087 - tgross35:core-float-math, r=<try>
Initial implementation of `core_float_math` Since [1], `compiler-builtins` makes a certain set of math symbols weakly available on all platforms. This means we can begin exposing some of the related functions in `core`, so begin this process here. It is not possible to provide inherent methods in both `core` and `std` while giving them different stability gates, so standalone functions are added instead. This provides a way to experiment with the functionality while unstable; once it is time to stabilize, they can be converted to inherent. For `f16` and `f128`, everything is unstable so we can move the inherent methods. The following are included to start: * floor * ceil * round * round_ties_even * trunc * fract * mul_add * div_euclid * rem_euclid * powi * sqrt * abs_sub * cbrt These mirror the set of functions that we have in `compiler-builtins` since [1], with the exception of `powi` that has been there longer. Details for each of the changes is in the commit messages. Tracking issue: rust-lang#137578 [1]: rust-lang/compiler-builtins#763 try-job: aarch64-apple try-job: aarch64-gnu try-job: arm-android tru-job: armhf-gnu try-job: dist-various-1 try-job: dist-various-2 try-job: i686-msvc-1 try-job: test-various try-job: x86_64-apple-1 try-job: x86_64-msvc-ext2
2 parents efcbb94 + 19edee9 commit 088086a

File tree

26 files changed

+4764
-3762
lines changed

26 files changed

+4764
-3762
lines changed

compiler/rustc_codegen_cranelift/patches/0027-sysroot_tests-128bit-atomic-operations.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ index 1e336bf..35e6f54 100644
1616
+++ b/coretests/tests/lib.rs
1717
@@ -2,5 +2,4 @@
1818
// tidy-alphabetical-start
19+
#![cfg_attr(not(bootstrap), feature(cfg_target_has_reliable_f16_f128))]
1920
-#![cfg_attr(target_has_atomic = "128", feature(integer_atomics))]
2021
#![cfg_attr(test, feature(cfg_match))]
2122
#![feature(alloc_layout_extra)]
22-
#![feature(array_chunks)]
2323
diff --git a/coretests/tests/atomic.rs b/coretests/tests/atomic.rs
2424
index b735957..ea728b6 100644
2525
--- a/coretests/tests/atomic.rs

library/core/Cargo.toml

+6
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,10 @@ check-cfg = [
3636
# and to stdarch `core_arch` crate which messes-up with Cargo list
3737
# of declared features, we therefor expect any feature cfg
3838
'cfg(feature, values(any()))',
39+
# Internal features aren't marked known config by default, we use these to
40+
# gate tests.
41+
'cfg(target_has_reliable_f16)',
42+
'cfg(target_has_reliable_f16_math)',
43+
'cfg(target_has_reliable_f128)',
44+
'cfg(target_has_reliable_f128_math)',
3945
]

0 commit comments

Comments
 (0)