about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAntoni Boucher <bouanto@zoho.com>2025-05-21 21:04:07 -0400
committerAntoni Boucher <bouanto@zoho.com>2025-05-21 21:04:07 -0400
commitdca28e588cb9c49bf275c073e28663bfc8393b5f (patch)
treec43abe38678ff37990434205d3b59ff111f21f78
parent593d7ca571bb00d87713110f4566208727238c0e (diff)
downloadrust-dca28e588cb9c49bf275c073e28663bfc8393b5f.tar.gz
rust-dca28e588cb9c49bf275c073e28663bfc8393b5f.zip
Only specify that we have reliable f16 and f128 on targets where those types are supported
-rw-r--r--src/lib.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 6994c385fc8..66e9ce4627c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -521,13 +521,16 @@ fn target_config(sess: &Session, target_info: &LockedTargetInfo) -> TargetConfig
     let target_features = f(false);
     let unstable_target_features = f(true);
 
+    let has_reliable_f16 = target_info.supports_target_dependent_type(CType::Float16);
+    let has_reliable_f128 = target_info.supports_target_dependent_type(CType::Float128);
+
     TargetConfig {
         target_features,
         unstable_target_features,
         // There are no known bugs with GCC support for f16 or f128
-        has_reliable_f16: true,
-        has_reliable_f16_math: true,
-        has_reliable_f128: true,
-        has_reliable_f128_math: true,
+        has_reliable_f16,
+        has_reliable_f16_math: has_reliable_f16,
+        has_reliable_f128,
+        has_reliable_f128_math: has_reliable_f128,
     }
 }