Skip to content

Commit b986d9b

Browse files
authored
Rollup merge of rust-lang#128349 - tgross35:x86-f16, r=Noratrieb
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]: rust-lang#125016 try-job: i686-gnu try-job: dist-i586-gnu-i586-i686-musl
2 parents c6d3a99 + 0a5d5ff commit b986d9b

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
@@ -261,7 +261,7 @@ impl f16 {
261261
///
262262
/// ```
263263
/// #![feature(f16)]
264-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
264+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
265265
///
266266
/// let nan = f16::NAN;
267267
/// let f = 7.0_f16;
@@ -293,7 +293,7 @@ impl f16 {
293293
///
294294
/// ```
295295
/// #![feature(f16)]
296-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
296+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
297297
///
298298
/// let f = 7.0f16;
299299
/// let inf = f16::INFINITY;
@@ -319,7 +319,7 @@ impl f16 {
319319
///
320320
/// ```
321321
/// #![feature(f16)]
322-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
322+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
323323
///
324324
/// let f = 7.0f16;
325325
/// let inf: f16 = f16::INFINITY;
@@ -347,7 +347,7 @@ impl f16 {
347347
///
348348
/// ```
349349
/// #![feature(f16)]
350-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
350+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
351351
///
352352
/// let min = f16::MIN_POSITIVE; // 6.1035e-5
353353
/// let max = f16::MAX;
@@ -377,7 +377,7 @@ impl f16 {
377377
///
378378
/// ```
379379
/// #![feature(f16)]
380-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
380+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
381381
///
382382
/// let min = f16::MIN_POSITIVE; // 6.1035e-5
383383
/// let max = f16::MAX;
@@ -409,7 +409,7 @@ impl f16 {
409409
///
410410
/// ```
411411
/// #![feature(f16)]
412-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
412+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
413413
///
414414
/// use std::num::FpCategory;
415415
///
@@ -867,7 +867,7 @@ impl f16 {
867867
///
868868
/// ```
869869
/// #![feature(f16)]
870-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
870+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
871871
///
872872
/// let value = 4.6_f16;
873873
/// let rounded = unsafe { value.to_int_unchecked::<u16>() };
@@ -910,7 +910,7 @@ impl f16 {
910910
///
911911
/// ```
912912
/// #![feature(f16)]
913-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
913+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
914914
///
915915
/// # // FIXME(f16_f128): enable this once const casting works
916916
/// # // assert_ne!((1f16).to_bits(), 1f16 as u128); // to_bits() is not casting!
@@ -958,7 +958,7 @@ impl f16 {
958958
///
959959
/// ```
960960
/// #![feature(f16)]
961-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
961+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
962962
///
963963
/// let v = f16::from_bits(0x4a40);
964964
/// assert_eq!(v, 12.5);
@@ -1071,7 +1071,7 @@ impl f16 {
10711071
///
10721072
/// ```
10731073
/// #![feature(f16)]
1074-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
1074+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
10751075
///
10761076
/// let value = f16::from_be_bytes([0x4a, 0x40]);
10771077
/// assert_eq!(value, 12.5);
@@ -1094,7 +1094,7 @@ impl f16 {
10941094
///
10951095
/// ```
10961096
/// #![feature(f16)]
1097-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
1097+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
10981098
///
10991099
/// let value = f16::from_le_bytes([0x40, 0x4a]);
11001100
/// assert_eq!(value, 12.5);
@@ -1124,7 +1124,7 @@ impl f16 {
11241124
///
11251125
/// ```
11261126
/// #![feature(f16)]
1127-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
1127+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
11281128
///
11291129
/// let value = f16::from_ne_bytes(if cfg!(target_endian = "big") {
11301130
/// [0x4a, 0x40]
@@ -1257,7 +1257,7 @@ impl f16 {
12571257
///
12581258
/// ```
12591259
/// #![feature(f16)]
1260-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
1260+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
12611261
///
12621262
/// assert!((-3.0f16).clamp(-2.0, 1.0) == -2.0);
12631263
/// assert!((0.0f16).clamp(-2.0, 1.0) == 0.0);

library/std/build.rs

-3
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ fn main() {
103103
("arm64ec", _) => false,
104104
// MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>
105105
("x86_64", "windows") => false,
106-
// x86 has ABI bugs that show up with optimizations. This should be partially fixed with
107-
// the compiler-builtins update. <https://github.com/rust-lang/rust/issues/123885>
108-
("x86" | "x86_64", _) => false,
109106
// Missing `__gnu_h2f_ieee` and `__gnu_f2h_ieee`
110107
("powerpc" | "powerpc64", _) => false,
111108
// Missing `__gnu_h2f_ieee` and `__gnu_f2h_ieee`

0 commit comments

Comments
 (0)