Skip to content

Commit

Permalink
core: MIPS: Disable four f16 doctests that fails to link
Browse files Browse the repository at this point in the history
Otherwise they fail to link with

    undefined reference to `__gnu_h2f_ieee'
    undefined reference to `__gnu_f2h_ieee'
  • Loading branch information
Martin Nordholts committed Jul 2, 2024
1 parent 91e4a09 commit d88500d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions library/core/src/num/f16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,12 +509,15 @@ impl f16 {
/// #![feature(f16)]
/// # // FIXME(f16_f128): remove when `extendhfsf2` and `truncsfhf2` are available
/// # #[cfg(target_os = "linux")] {
/// # // FIXME(f16_f128): remove when `__gnu_h2f_ieee` and `__gnu_f2h_ieee` are available
/// # #[cfg(not(all(target_arch = "mips", target_os = "linux")))] {
///
/// let x = 2.0_f16;
/// let abs_difference = (x.recip() - (1.0 / x)).abs();
///
/// assert!(abs_difference <= f16::EPSILON);
/// # }
/// # }
/// ```
#[inline]
#[cfg(not(bootstrap))]
Expand All @@ -530,12 +533,15 @@ impl f16 {
/// #![feature(f16)]
/// # // FIXME(f16_f128): remove when `extendhfsf2` and `truncsfhf2` are available
/// # #[cfg(target_os = "linux")] {
/// # // FIXME(f16_f128): remove when `__gnu_h2f_ieee` and `__gnu_f2h_ieee` are available
/// # #[cfg(not(all(target_arch = "mips", target_os = "linux")))] {
///
/// let angle = std::f16::consts::PI;
///
/// let abs_difference = (angle.to_degrees() - 180.0).abs();
/// assert!(abs_difference <= 0.5);
/// # }
/// # }
/// ```
#[inline]
#[cfg(not(bootstrap))]
Expand All @@ -553,13 +559,16 @@ impl f16 {
/// #![feature(f16)]
/// # // FIXME(f16_f128): remove when `extendhfsf2` and `truncsfhf2` are available
/// # #[cfg(target_os = "linux")] {
/// # // FIXME(f16_f128): remove when `__gnu_h2f_ieee` and `__gnu_f2h_ieee` are available
/// # #[cfg(not(all(target_arch = "mips", target_os = "linux")))] {
///
/// let angle = 180.0f16;
///
/// let abs_difference = (angle.to_radians() - std::f16::consts::PI).abs();
///
/// assert!(abs_difference <= 0.01);
/// # }
/// # }
/// ```
#[inline]
#[cfg(not(bootstrap))]
Expand Down Expand Up @@ -870,6 +879,8 @@ impl f16 {
///
/// ```
/// #![feature(f16)]
/// # // FIXME(f16_f128): remove when `__gnu_h2f_ieee` and `__gnu_f2h_ieee` are available
/// # #[cfg(not(all(target_arch = "mips", target_os = "linux")))] {
///
/// struct GoodBoy {
/// name: &'static str,
Expand Down Expand Up @@ -897,6 +908,7 @@ impl f16 {
/// .zip([-5.0, 0.1, 10.0, 99.0, f16::INFINITY, f16::NAN].iter())
/// .for_each(|(a, b)| assert_eq!(a.to_bits(), b.to_bits()))
/// }
/// # }
/// ```
#[inline]
#[must_use]
Expand Down

0 comments on commit d88500d

Please sign in to comment.