Skip to content

Commit 1d3189c

Browse files
committed
Auto merge of #128349 - tgross35:x86-f16, r=<try>
Enable `f16` on x86 and x86-64 Since the `compiler_builtins` update [1], ABI bugs on x86 should be resolved. Enable tests for f16 on these platforms now. [1]: #125016 try-job: i686-gnu try-job: dist-i586-gnu-i586-i686-musl
2 parents 4db3d12 + bd348e0 commit 1d3189c

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

library/core/src/num/f16.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ impl f16 {
267267
///
268268
/// ```
269269
/// #![feature(f16)]
270-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
270+
/// # #[cfg(target_arch = "x86_64")] {
271271
///
272272
/// let nan = f16::NAN;
273273
/// let f = 7.0_f16;
@@ -301,7 +301,7 @@ impl f16 {
301301
///
302302
/// ```
303303
/// #![feature(f16)]
304-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
304+
/// # #[cfg(target_arch = "x86_64")] {
305305
///
306306
/// let f = 7.0f16;
307307
/// let inf = f16::INFINITY;
@@ -328,7 +328,7 @@ impl f16 {
328328
///
329329
/// ```
330330
/// #![feature(f16)]
331-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
331+
/// # #[cfg(target_arch = "x86_64")] {
332332
///
333333
/// let f = 7.0f16;
334334
/// let inf: f16 = f16::INFINITY;
@@ -357,7 +357,7 @@ impl f16 {
357357
///
358358
/// ```
359359
/// #![feature(f16)]
360-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
360+
/// # #[cfg(target_arch = "x86_64")] {
361361
///
362362
/// let min = f16::MIN_POSITIVE; // 6.1035e-5
363363
/// let max = f16::MAX;
@@ -388,7 +388,7 @@ impl f16 {
388388
///
389389
/// ```
390390
/// #![feature(f16)]
391-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
391+
/// # #[cfg(target_arch = "x86_64")] {
392392
///
393393
/// let min = f16::MIN_POSITIVE; // 6.1035e-5
394394
/// let max = f16::MAX;
@@ -421,7 +421,7 @@ impl f16 {
421421
///
422422
/// ```
423423
/// #![feature(f16)]
424-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
424+
/// # #[cfg(target_arch = "x86_64")] {
425425
///
426426
/// use std::num::FpCategory;
427427
///
@@ -744,7 +744,7 @@ impl f16 {
744744
///
745745
/// ```
746746
/// #![feature(f16)]
747-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
747+
/// # #[cfg(target_arch = "x86_64")] {
748748
///
749749
/// let value = 4.6_f16;
750750
/// let rounded = unsafe { value.to_int_unchecked::<u16>() };
@@ -787,7 +787,7 @@ impl f16 {
787787
///
788788
/// ```
789789
/// #![feature(f16)]
790-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
790+
/// # #[cfg(target_arch = "x86_64")] {
791791
///
792792
/// # // FIXME(f16_f128): enable this once const casting works
793793
/// # // assert_ne!((1f16).to_bits(), 1f16 as u128); // to_bits() is not casting!
@@ -876,7 +876,7 @@ impl f16 {
876876
///
877877
/// ```
878878
/// #![feature(f16)]
879-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
879+
/// # #[cfg(target_arch = "x86_64")] {
880880
///
881881
/// let v = f16::from_bits(0x4a40);
882882
/// assert_eq!(v, 12.5);
@@ -1030,7 +1030,7 @@ impl f16 {
10301030
///
10311031
/// ```
10321032
/// #![feature(f16)]
1033-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
1033+
/// # #[cfg(target_arch = "x86_64")] {
10341034
///
10351035
/// let value = f16::from_be_bytes([0x4a, 0x40]);
10361036
/// assert_eq!(value, 12.5);
@@ -1053,7 +1053,7 @@ impl f16 {
10531053
///
10541054
/// ```
10551055
/// #![feature(f16)]
1056-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
1056+
/// # #[cfg(target_arch = "x86_64")] {
10571057
///
10581058
/// let value = f16::from_le_bytes([0x40, 0x4a]);
10591059
/// assert_eq!(value, 12.5);
@@ -1083,7 +1083,7 @@ impl f16 {
10831083
///
10841084
/// ```
10851085
/// #![feature(f16)]
1086-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
1086+
/// # #[cfg(target_arch = "x86_64")] {
10871087
///
10881088
/// let value = f16::from_ne_bytes(if cfg!(target_endian = "big") {
10891089
/// [0x4a, 0x40]
@@ -1217,7 +1217,7 @@ impl f16 {
12171217
///
12181218
/// ```
12191219
/// #![feature(f16)]
1220-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
1220+
/// # #[cfg(target_arch = "x86_64")] {
12211221
///
12221222
/// assert!((-3.0f16).clamp(-2.0, 1.0) == -2.0);
12231223
/// assert!((0.0f16).clamp(-2.0, 1.0) == 0.0);

library/std/build.rs

-3
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,6 @@ fn main() {
9595
("arm64ec", _) => false,
9696
// MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>
9797
("x86", "windows") => false,
98-
// x86 has ABI bugs that show up with optimizations. This should be partially fixed with
99-
// the compiler-builtins update. <https://github.com/rust-lang/rust/issues/123885>
100-
("x86" | "x86_64", _) => false,
10198
// Missing `__gnu_h2f_ieee` and `__gnu_f2h_ieee`
10299
("powerpc" | "powerpc64", _) => false,
103100
// Missing `__gnu_h2f_ieee` and `__gnu_f2h_ieee`

0 commit comments

Comments
 (0)