Skip to content

Commit

Permalink
Change f16 doctests in core to run on x86-64
Browse files Browse the repository at this point in the history
Since `f16` now works on x86 and x86-64, change doctests to use this
instead of aarch64. This is to make sure any changes get run in PR CI.
  • Loading branch information
tgross35 committed Jul 31, 2024
1 parent e518451 commit 0a5d5ff
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions library/core/src/num/f16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
///
/// let nan = f16::NAN;
/// let f = 7.0_f16;
Expand Down Expand Up @@ -293,7 +293,7 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
///
/// let f = 7.0f16;
/// let inf = f16::INFINITY;
Expand All @@ -319,7 +319,7 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
///
/// let f = 7.0f16;
/// let inf: f16 = f16::INFINITY;
Expand Down Expand Up @@ -347,7 +347,7 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
///
/// let min = f16::MIN_POSITIVE; // 6.1035e-5
/// let max = f16::MAX;
Expand Down Expand Up @@ -377,7 +377,7 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
///
/// let min = f16::MIN_POSITIVE; // 6.1035e-5
/// let max = f16::MAX;
Expand Down Expand Up @@ -409,7 +409,7 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
///
/// use std::num::FpCategory;
///
Expand Down Expand Up @@ -725,7 +725,7 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
///
/// let value = 4.6_f16;
/// let rounded = unsafe { value.to_int_unchecked::<u16>() };
Expand Down Expand Up @@ -768,7 +768,7 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
///
/// # // FIXME(f16_f128): enable this once const casting works
/// # // assert_ne!((1f16).to_bits(), 1f16 as u128); // to_bits() is not casting!
Expand Down Expand Up @@ -857,7 +857,7 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
///
/// let v = f16::from_bits(0x4a40);
/// assert_eq!(v, 12.5);
Expand Down Expand Up @@ -1011,7 +1011,7 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
///
/// let value = f16::from_be_bytes([0x4a, 0x40]);
/// assert_eq!(value, 12.5);
Expand All @@ -1034,7 +1034,7 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
///
/// let value = f16::from_le_bytes([0x40, 0x4a]);
/// assert_eq!(value, 12.5);
Expand Down Expand Up @@ -1064,7 +1064,7 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
///
/// let value = f16::from_ne_bytes(if cfg!(target_endian = "big") {
/// [0x4a, 0x40]
Expand Down Expand Up @@ -1197,7 +1197,7 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # #[cfg(target_arch = "aarch64")] { // FIXME(f16_F128): rust-lang/rust#123885
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
///
/// assert!((-3.0f16).clamp(-2.0, 1.0) == -2.0);
/// assert!((0.0f16).clamp(-2.0, 1.0) == 0.0);
Expand Down

0 comments on commit 0a5d5ff

Please sign in to comment.