mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
f16,f128: Resolve cfg-releated instances of FIXME(f16_f128)
There are a number of instances of `FIXME(f16_f128)` related to target configuration; either these could use `target_has_reliable_f128`, or the FIXME is describing such a cfg and is thus redundant (since any `cfg(target_has_reliable_f*)` needs to be removed before stabilization anyway). Switch to using `target_has_reliable_*` where applicable and remove the redundant FIXMEs.
This commit is contained in:
@@ -137,10 +137,8 @@ pub mod consts {
|
||||
pub const LN_10: f128 = 2.30258509299404568401799145468436420760110148862877297603333_f128;
|
||||
}
|
||||
|
||||
#[doc(test(attr(feature(cfg_target_has_reliable_f16_f128), allow(internal_features))))]
|
||||
impl f128 {
|
||||
// FIXME(f16_f128): almost all methods in this `impl` are missing examples and a const
|
||||
// implementation. Add these once we can run code on all platforms and have f16/f128 in CTFE.
|
||||
|
||||
/// The radix or base of the internal representation of `f128`.
|
||||
#[unstable(feature = "f128", issue = "116909")]
|
||||
pub const RADIX: u32 = 2;
|
||||
@@ -277,8 +275,7 @@ impl f128 {
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(f128)]
|
||||
/// # // FIXME(f16_f128): remove when `unordtf2` is available
|
||||
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128)] {
|
||||
///
|
||||
/// let nan = f128::NAN;
|
||||
/// let f = 7.0_f128;
|
||||
@@ -300,8 +297,7 @@ pub const fn is_nan(self) -> bool {
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(f128)]
|
||||
/// # // FIXME(f16_f128): remove when `eqtf2` is available
|
||||
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128)] {
|
||||
///
|
||||
/// let f = 7.0f128;
|
||||
/// let inf = f128::INFINITY;
|
||||
@@ -326,8 +322,7 @@ pub const fn is_infinite(self) -> bool {
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(f128)]
|
||||
/// # // FIXME(f16_f128): remove when `lttf2` is available
|
||||
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128)] {
|
||||
///
|
||||
/// let f = 7.0f128;
|
||||
/// let inf: f128 = f128::INFINITY;
|
||||
@@ -355,8 +350,7 @@ pub const fn is_finite(self) -> bool {
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(f128)]
|
||||
/// # // FIXME(f16_f128): remove when `eqtf2` is available
|
||||
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128)] {
|
||||
///
|
||||
/// let min = f128::MIN_POSITIVE; // 3.362103143e-4932f128
|
||||
/// let max = f128::MAX;
|
||||
@@ -386,8 +380,7 @@ pub const fn is_subnormal(self) -> bool {
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(f128)]
|
||||
/// # // FIXME(f16_f128): remove when `eqtf2` is available
|
||||
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128)] {
|
||||
///
|
||||
/// let min = f128::MIN_POSITIVE; // 3.362103143e-4932f128
|
||||
/// let max = f128::MAX;
|
||||
@@ -419,8 +412,7 @@ pub const fn is_normal(self) -> bool {
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(f128)]
|
||||
/// # // FIXME(f16_f128): remove when `eqtf2` is available
|
||||
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128)] {
|
||||
///
|
||||
/// use std::num::FpCategory;
|
||||
///
|
||||
@@ -514,8 +506,7 @@ pub const fn is_sign_negative(self) -> bool {
|
||||
///
|
||||
/// ```rust
|
||||
/// #![feature(f128)]
|
||||
/// # // FIXME(f16_f128): remove when `eqtf2` is available
|
||||
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128)] {
|
||||
///
|
||||
/// // f128::EPSILON is the difference between 1.0 and the next number up.
|
||||
/// assert_eq!(1.0f128.next_up(), 1.0 + f128::EPSILON);
|
||||
@@ -569,8 +560,7 @@ pub const fn next_up(self) -> Self {
|
||||
///
|
||||
/// ```rust
|
||||
/// #![feature(f128)]
|
||||
/// # // FIXME(f16_f128): remove when `eqtf2` is available
|
||||
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128)] {
|
||||
///
|
||||
/// let x = 1.0f128;
|
||||
/// // Clamp value into range [0, 1).
|
||||
@@ -613,8 +603,7 @@ pub const fn next_down(self) -> Self {
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(f128)]
|
||||
/// # // FIXME(f16_f128): remove when `eqtf2` is available
|
||||
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128)] {
|
||||
///
|
||||
/// let x = 2.0_f128;
|
||||
/// let abs_difference = (x.recip() - (1.0 / x)).abs();
|
||||
@@ -640,8 +629,7 @@ pub const fn recip(self) -> Self {
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(f128)]
|
||||
/// # // FIXME(f16_f128): remove when `eqtf2` is available
|
||||
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128)] {
|
||||
///
|
||||
/// let angle = std::f128::consts::PI;
|
||||
///
|
||||
@@ -671,8 +659,7 @@ pub const fn to_degrees(self) -> Self {
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(f128)]
|
||||
/// # // FIXME(f16_f128): remove when `eqtf2` is available
|
||||
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128)] {
|
||||
///
|
||||
/// let angle = 180.0f128;
|
||||
///
|
||||
@@ -706,8 +693,7 @@ pub const fn to_radians(self) -> f128 {
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(f128)]
|
||||
/// # // Using aarch64 because `reliable_f128_math` is needed
|
||||
/// # #[cfg(all(target_arch = "aarch64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128_math)] {
|
||||
///
|
||||
/// let x = 1.0f128;
|
||||
/// let y = 2.0f128;
|
||||
@@ -738,8 +724,7 @@ pub const fn max(self, other: f128) -> f128 {
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(f128)]
|
||||
/// # // Using aarch64 because `reliable_f128_math` is needed
|
||||
/// # #[cfg(all(target_arch = "aarch64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128_math)] {
|
||||
///
|
||||
/// let x = 1.0f128;
|
||||
/// let y = 2.0f128;
|
||||
@@ -771,8 +756,7 @@ pub const fn min(self, other: f128) -> f128 {
|
||||
/// ```
|
||||
/// #![feature(f128)]
|
||||
/// #![feature(float_minimum_maximum)]
|
||||
/// # // Using aarch64 because `reliable_f128_math` is needed
|
||||
/// # #[cfg(all(target_arch = "aarch64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128_math)] {
|
||||
///
|
||||
/// let x = 1.0f128;
|
||||
/// let y = 2.0f128;
|
||||
@@ -804,8 +788,7 @@ pub const fn maximum(self, other: f128) -> f128 {
|
||||
/// ```
|
||||
/// #![feature(f128)]
|
||||
/// #![feature(float_minimum_maximum)]
|
||||
/// # // Using aarch64 because `reliable_f128_math` is needed
|
||||
/// # #[cfg(all(target_arch = "aarch64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128_math)] {
|
||||
///
|
||||
/// let x = 1.0f128;
|
||||
/// let y = 2.0f128;
|
||||
@@ -831,8 +814,7 @@ pub const fn minimum(self, other: f128) -> f128 {
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(f128)]
|
||||
/// # // Using aarch64 because `reliable_f128_math` is needed
|
||||
/// # #[cfg(all(target_arch = "aarch64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128)] {
|
||||
///
|
||||
/// assert_eq!(1f128.midpoint(4.0), 2.5);
|
||||
/// assert_eq!((-5.5f128).midpoint(8.0), 1.25);
|
||||
@@ -862,8 +844,7 @@ pub const fn midpoint(self, other: f128) -> f128 {
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(f128)]
|
||||
/// # // FIXME(f16_f128): remove when `float*itf` is available
|
||||
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128)] {
|
||||
///
|
||||
/// let value = 4.6_f128;
|
||||
/// let rounded = unsafe { value.to_int_unchecked::<u16>() };
|
||||
@@ -952,8 +933,7 @@ pub const fn to_bits(self) -> u128 {
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(f128)]
|
||||
/// # // FIXME(f16_f128): remove when `eqtf2` is available
|
||||
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128)] {
|
||||
///
|
||||
/// let v = f128::from_bits(0x40029000000000000000000000000000);
|
||||
/// assert_eq!(v, 12.5);
|
||||
@@ -1064,8 +1044,7 @@ pub const fn from_bits(v: u128) -> Self {
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(f128)]
|
||||
/// # // FIXME(f16_f128): remove when `eqtf2` is available
|
||||
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128)] {
|
||||
///
|
||||
/// let value = f128::from_be_bytes(
|
||||
/// [0x40, 0x02, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -1090,8 +1069,7 @@ pub const fn from_bits(v: u128) -> Self {
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(f128)]
|
||||
/// # // FIXME(f16_f128): remove when `eqtf2` is available
|
||||
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128)] {
|
||||
///
|
||||
/// let value = f128::from_le_bytes(
|
||||
/// [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -1123,8 +1101,7 @@ pub const fn from_bits(v: u128) -> Self {
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(f128)]
|
||||
/// # // FIXME(f16_f128): remove when `eqtf2` is available
|
||||
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128)] {
|
||||
///
|
||||
/// let value = f128::from_ne_bytes(if cfg!(target_endian = "big") {
|
||||
/// [0x40, 0x02, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -1257,8 +1234,7 @@ pub const fn total_cmp(&self, other: &Self) -> crate::cmp::Ordering {
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(f128)]
|
||||
/// # // FIXME(f16_f128): remove when `{eq,gt,unord}tf` are available
|
||||
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128)] {
|
||||
///
|
||||
/// assert!((-3.0f128).clamp(-2.0, 1.0) == -2.0);
|
||||
/// assert!((0.0f128).clamp(-2.0, 1.0) == 0.0);
|
||||
@@ -1333,7 +1309,7 @@ pub fn clamp_magnitude(self, limit: f128) -> f128 {
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(f128)]
|
||||
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128)] {
|
||||
///
|
||||
/// let x = 3.5_f128;
|
||||
/// let y = -3.5_f128;
|
||||
@@ -1364,7 +1340,7 @@ pub const fn abs(self) -> Self {
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(f128)]
|
||||
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128)] {
|
||||
///
|
||||
/// let f = 3.5_f128;
|
||||
///
|
||||
@@ -1400,7 +1376,7 @@ pub const fn signum(self) -> f128 {
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(f128)]
|
||||
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
|
||||
/// # #[cfg(target_has_reliable_f128)] {
|
||||
///
|
||||
/// let f = 3.5_f128;
|
||||
///
|
||||
@@ -1477,8 +1453,6 @@ pub const fn algebraic_rem(self, rhs: f128) -> f128 {
|
||||
}
|
||||
|
||||
// Functions in this module fall into `core_float_math`
|
||||
// FIXME(f16_f128): all doctests must be gated to platforms that have `long double` === `_Float128`
|
||||
// due to https://github.com/llvm/llvm-project/issues/44744. aarch64 linux matches this.
|
||||
// #[unstable(feature = "core_float_math", issue = "137578")]
|
||||
#[cfg(not(test))]
|
||||
#[doc(test(attr(feature(cfg_target_has_reliable_f16_f128), expect(internal_features))))]
|
||||
|
||||
@@ -134,9 +134,6 @@ pub mod consts {
|
||||
|
||||
#[doc(test(attr(feature(cfg_target_has_reliable_f16_f128), allow(internal_features))))]
|
||||
impl f16 {
|
||||
// FIXME(f16_f128): almost all methods in this `impl` are missing examples and a const
|
||||
// implementation. Add these once we can run code on all platforms and have f16/f128 in CTFE.
|
||||
|
||||
/// The radix or base of the internal representation of `f16`.
|
||||
#[unstable(feature = "f16", issue = "116909")]
|
||||
pub const RADIX: u32 = 2;
|
||||
|
||||
@@ -1357,15 +1357,11 @@ const fn q_nan() -> Float {
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME(f16): Tests involving sNaN are disabled because without optimizations, `total_cmp` is
|
||||
// getting incorrectly lowered to code that includes a `extend`/`trunc` round trip, which quiets
|
||||
// sNaNs. See: https://github.com/llvm/llvm-project/issues/104915
|
||||
|
||||
float_test! {
|
||||
name: total_cmp_s_nan,
|
||||
attrs: {
|
||||
const: #[cfg(false)],
|
||||
f16: #[cfg(miri)],
|
||||
f16: #[cfg(any(miri, target_has_reliable_f16_math))],
|
||||
f128: #[cfg(any(miri, target_has_reliable_f128_math))],
|
||||
},
|
||||
test<Float> {
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
const FPATHS_F64: &[FPath<f64>] =
|
||||
&[((0, 0, false, false), Some(0.0)), ((0, 0, false, false), Some(0.0))];
|
||||
|
||||
// FIXME(f16_f128): enable on all targets once possible.
|
||||
#[test]
|
||||
#[cfg(target_has_reliable_f16)]
|
||||
fn check_fast_path_f16() {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
use crate::num::{ldexp_f32, ldexp_f64};
|
||||
|
||||
// FIXME(f16_f128): enable on all targets once possible.
|
||||
#[test]
|
||||
#[cfg(target_has_reliable_f16)]
|
||||
fn test_f16_integer_decode() {
|
||||
@@ -54,7 +53,6 @@ fn test_f64_integer_decode() {
|
||||
|
||||
/* Sanity checks of computed magic numbers */
|
||||
|
||||
// FIXME(f16_f128): enable on all targets once possible.
|
||||
#[test]
|
||||
#[cfg(target_has_reliable_f16)]
|
||||
fn test_f16_consts() {
|
||||
|
||||
@@ -17,7 +17,6 @@ fn compute_float64(q: i64, w: u64) -> (i32, u64) {
|
||||
(fp.p_biased, fp.m)
|
||||
}
|
||||
|
||||
// FIXME(f16_f128): enable on all targets once possible.
|
||||
#[test]
|
||||
#[cfg(target_has_reliable_f16)]
|
||||
fn compute_float_f16_rounding() {
|
||||
|
||||
@@ -92,8 +92,6 @@ fn fast_path_correct() {
|
||||
test_literal!(1.448997445238699);
|
||||
}
|
||||
|
||||
// FIXME(f16_f128): remove gates once tests work on all targets
|
||||
|
||||
#[test]
|
||||
fn lonely_dot() {
|
||||
#[cfg(target_has_reliable_f16)]
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// FIXME(f16_f128): only tested on platforms that have symbols and aren't buggy
|
||||
#![cfg(target_has_reliable_f128)]
|
||||
|
||||
use std::f128::consts;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// FIXME(f16_f128): only tested on platforms that have symbols and aren't buggy
|
||||
#![cfg(target_has_reliable_f16)]
|
||||
|
||||
use std::f16::consts;
|
||||
@@ -258,8 +257,6 @@ fn test_ln_gamma() {
|
||||
|
||||
#[test]
|
||||
fn test_real_consts() {
|
||||
// FIXME(f16_f128): add math tests when available
|
||||
|
||||
let pi: f16 = consts::PI;
|
||||
let frac_pi_2: f16 = consts::FRAC_PI_2;
|
||||
let frac_pi_3: f16 = consts::FRAC_PI_3;
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
//@ run-pass
|
||||
//@ compile-flags: --check-cfg=cfg(target_has_reliable_f16,target_has_reliable_f128)
|
||||
|
||||
// Test half-open range patterns against their expression equivalents
|
||||
// via `.contains(...)` and make sure the dynamic semantics match.
|
||||
|
||||
#![allow(unreachable_patterns)]
|
||||
#![feature(cfg_target_has_reliable_f16_f128)]
|
||||
#![feature(f128)]
|
||||
#![feature(f16)]
|
||||
|
||||
@@ -42,8 +44,7 @@ fn range_to_inclusive() {
|
||||
assert!(!yes!('b', ..='a'));
|
||||
|
||||
// f16; `..=X`
|
||||
// FIXME(f16_f128): remove gate when ABI issues are resolved
|
||||
#[cfg(all(target_arch = "aarch64", target_os = "linux"))]
|
||||
#[cfg(target_has_reliable_f16)]
|
||||
{
|
||||
assert!(yes!(f16::NEG_INFINITY, ..=f16::NEG_INFINITY));
|
||||
assert!(yes!(f16::NEG_INFINITY, ..=1.0f16));
|
||||
@@ -64,8 +65,7 @@ fn range_to_inclusive() {
|
||||
assert!(!yes!(1.6f64, ..=-1.5f64));
|
||||
|
||||
// f128; `..=X`
|
||||
// FIXME(f16_f128): remove gate when ABI issues are resolved
|
||||
#[cfg(all(target_arch = "aarch64", target_os = "linux"))]
|
||||
#[cfg(target_has_reliable_f128)]
|
||||
{
|
||||
assert!(yes!(f128::NEG_INFINITY, ..=f128::NEG_INFINITY));
|
||||
assert!(yes!(f128::NEG_INFINITY, ..=1.0f128));
|
||||
@@ -106,8 +106,7 @@ fn range_to() {
|
||||
assert!(!yes!('b', ..'a'));
|
||||
|
||||
// f16; `..X`
|
||||
// FIXME(f16_f128): remove gate when ABI issues are resolved
|
||||
#[cfg(all(target_arch = "aarch64", target_os = "linux"))]
|
||||
#[cfg(target_has_reliable_f16)]
|
||||
{
|
||||
assert!(yes!(f16::NEG_INFINITY, ..1.0f16));
|
||||
assert!(!yes!(1.5f16, ..1.5f16));
|
||||
@@ -131,8 +130,7 @@ fn range_to() {
|
||||
assert!(!yes!(1.6f64, ..1.5f64));
|
||||
|
||||
// f128; `..X`
|
||||
// FIXME(f16_f128): remove gate when ABI issues are resolved
|
||||
#[cfg(all(target_arch = "aarch64", target_os = "linux"))]
|
||||
#[cfg(target_has_reliable_f128)]
|
||||
{
|
||||
assert!(yes!(f128::NEG_INFINITY, ..1.0f128));
|
||||
assert!(!yes!(1.5f128, ..1.5f128));
|
||||
@@ -174,8 +172,7 @@ fn range_from() {
|
||||
assert!(yes!(core::char::MAX, core::char::MAX..));
|
||||
|
||||
// f16; `X..`
|
||||
// FIXME(f16_f128): remove gate when ABI issues are resolved
|
||||
#[cfg(all(target_arch = "aarch64", target_os = "linux"))]
|
||||
#[cfg(target_has_reliable_f16)]
|
||||
{
|
||||
assert!(yes!(f16::NEG_INFINITY, f16::NEG_INFINITY..));
|
||||
assert!(yes!(f16::INFINITY, f16::NEG_INFINITY..));
|
||||
@@ -208,8 +205,7 @@ fn range_from() {
|
||||
assert!(yes!(f64::INFINITY, f64::INFINITY..));
|
||||
|
||||
// f128; `X..`
|
||||
// FIXME(f16_f128): remove gate when ABI issues are resolved
|
||||
#[cfg(all(target_arch = "aarch64", target_os = "linux"))]
|
||||
#[cfg(target_has_reliable_f128)]
|
||||
{
|
||||
assert!(yes!(f128::NEG_INFINITY, f128::NEG_INFINITY..));
|
||||
assert!(yes!(f128::INFINITY, f128::NEG_INFINITY..));
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
//@ run-pass
|
||||
//@ compile-flags: --check-cfg=cfg(target_has_reliable_f16,target_has_reliable_f128)
|
||||
// Makes sure we use `==` (not bitwise) semantics for float comparison.
|
||||
|
||||
#![feature(cfg_target_has_reliable_f16_f128)]
|
||||
#![feature(f128)]
|
||||
#![feature(f16)]
|
||||
|
||||
// FIXME(f16_f128): remove gates when ABI issues are resolved
|
||||
|
||||
#[cfg(all(target_arch = "aarch64", target_os = "linux"))]
|
||||
#[cfg(target_has_reliable_f16)]
|
||||
fn check_f16() {
|
||||
const F1: f16 = 0.0;
|
||||
const F2: f16 = -0.0;
|
||||
@@ -34,7 +34,7 @@ fn check_f64() {
|
||||
assert!(matches!(F2, F1));
|
||||
}
|
||||
|
||||
#[cfg(all(target_arch = "aarch64", target_os = "linux"))]
|
||||
#[cfg(target_has_reliable_f128)]
|
||||
fn check_f128() {
|
||||
const F1: f128 = 0.0;
|
||||
const F2: f128 = -0.0;
|
||||
@@ -45,10 +45,10 @@ fn check_f128() {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
#[cfg(all(target_arch = "aarch64", target_os = "linux"))]
|
||||
#[cfg(target_has_reliable_f16)]
|
||||
check_f16();
|
||||
check_f32();
|
||||
check_f64();
|
||||
#[cfg(all(target_arch = "aarch64", target_os = "linux"))]
|
||||
#[cfg(target_has_reliable_f128)]
|
||||
check_f128();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user