Change f16
doctests in core to run on x86-64 · rust-lang/rust@0a5d5ff (original) (raw)
`@@ -261,7 +261,7 @@ impl f16 {
`
261
261
`///
`
262
262
```` /// ```
`263`
`263`
`/// #![feature(f16)]
`
`264`
``
`-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
`
``
`264`
`+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
`
`265`
`265`
`///
`
`266`
`266`
`/// let nan = f16::NAN;
`
`267`
`267`
`/// let f = 7.0_f16;
`
`@@ -293,7 +293,7 @@ impl f16 {
`
`293`
`293`
`///
`
`294`
`294`
```` /// ```
295
295
`/// #![feature(f16)]
`
296
``
`-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
`
``
296
`+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
`
297
297
`///
`
298
298
`/// let f = 7.0f16;
`
299
299
`/// let inf = f16::INFINITY;
`
`@@ -319,7 +319,7 @@ impl f16 {
`
319
319
`///
`
320
320
```` /// ```
`321`
`321`
`/// #![feature(f16)]
`
`322`
``
`-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
`
``
`322`
`+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
`
`323`
`323`
`///
`
`324`
`324`
`/// let f = 7.0f16;
`
`325`
`325`
`/// let inf: f16 = f16::INFINITY;
`
`@@ -347,7 +347,7 @@ impl f16 {
`
`347`
`347`
`///
`
`348`
`348`
```` /// ```
349
349
`/// #![feature(f16)]
`
350
``
`-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
`
``
350
`+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
`
351
351
`///
`
352
352
`/// let min = f16::MIN_POSITIVE; // 6.1035e-5
`
353
353
`/// let max = f16::MAX;
`
`@@ -377,7 +377,7 @@ impl f16 {
`
377
377
`///
`
378
378
```` /// ```
`379`
`379`
`/// #![feature(f16)]
`
`380`
``
`-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
`
``
`380`
`+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
`
`381`
`381`
`///
`
`382`
`382`
`/// let min = f16::MIN_POSITIVE; // 6.1035e-5
`
`383`
`383`
`/// let max = f16::MAX;
`
`@@ -409,7 +409,7 @@ impl f16 {
`
`409`
`409`
`///
`
`410`
`410`
```` /// ```
411
411
`/// #![feature(f16)]
`
412
``
`-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
`
``
412
`+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
`
413
413
`///
`
414
414
`/// use std::num::FpCategory;
`
415
415
`///
`
`@@ -725,7 +725,7 @@ impl f16 {
`
725
725
`///
`
726
726
```` /// ```
`727`
`727`
`/// #![feature(f16)]
`
`728`
``
`-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
`
``
`728`
`+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
`
`729`
`729`
`///
`
`730`
`730`
`/// let value = 4.6_f16;
`
`731`
`731`
`/// let rounded = unsafe { value.to_int_unchecked::<u16>() };
`
`@@ -768,7 +768,7 @@ impl f16 {
`
`768`
`768`
`///
`
`769`
`769`
```` /// ```
770
770
`/// #![feature(f16)]
`
771
``
`-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
`
``
771
`+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
`
772
772
`///
`
773
773
`/// # // FIXME(f16_f128): enable this once const casting works
`
774
774
`/// # // assert_ne!((1f16).to_bits(), 1f16 as u128); // to_bits() is not casting!
`
`@@ -857,7 +857,7 @@ impl f16 {
`
857
857
`///
`
858
858
```` /// ```
`859`
`859`
`/// #![feature(f16)]
`
`860`
``
`-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
`
``
`860`
`+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
`
`861`
`861`
`///
`
`862`
`862`
`/// let v = f16::from_bits(0x4a40);
`
`863`
`863`
`/// assert_eq!(v, 12.5);
`
`@@ -1011,7 +1011,7 @@ impl f16 {
`
`1011`
`1011`
`///
`
`1012`
`1012`
```` /// ```
1013
1013
`/// #![feature(f16)]
`
1014
``
`-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
`
``
1014
`+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
`
1015
1015
`///
`
1016
1016
`/// let value = f16::from_be_bytes([0x4a, 0x40]);
`
1017
1017
`/// assert_eq!(value, 12.5);
`
`@@ -1034,7 +1034,7 @@ impl f16 {
`
1034
1034
`///
`
1035
1035
```` /// ```
`1036`
`1036`
`/// #![feature(f16)]
`
`1037`
``
`-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
`
``
`1037`
`+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
`
`1038`
`1038`
`///
`
`1039`
`1039`
`/// let value = f16::from_le_bytes([0x40, 0x4a]);
`
`1040`
`1040`
`/// assert_eq!(value, 12.5);
`
`@@ -1064,7 +1064,7 @@ impl f16 {
`
`1064`
`1064`
`///
`
`1065`
`1065`
```` /// ```
1066
1066
`/// #![feature(f16)]
`
1067
``
`-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
`
``
1067
`+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
`
1068
1068
`///
`
1069
1069
`/// let value = f16::from_ne_bytes(if cfg!(target_endian = "big") {
`
1070
1070
`/// [0x4a, 0x40]
`
`@@ -1197,7 +1197,7 @@ impl f16 {
`
1197
1197
`///
`
1198
1198
```` /// ```
````
1199
1199
`/// #![feature(f16)]
`
1200
``
`-
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
`
``
1200
`+
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
`
1201
1201
`///
`
1202
1202
`/// assert!((-3.0f16).clamp(-2.0, 1.0) == -2.0);
`
1203
1203
`/// assert!((0.0f16).clamp(-2.0, 1.0) == 0.0);
`