about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2025-09-11 14:06:31 +1000
committerGitHub <noreply@github.com>2025-09-11 14:06:31 +1000
commit77ec4781c6df92f6582fec484305501796477212 (patch)
treed21df7109f2d602222a4d12649faeba7b8f99791 /compiler
parentc69a792137cd0e57cb8f07bd5a9eb9dd8ff6930d (diff)
parent3b2178336ff01d1db306be9ac48dc6eadc00763a (diff)
downloadrust-77ec4781c6df92f6582fec484305501796477212.tar.gz
rust-77ec4781c6df92f6582fec484305501796477212.zip
Rollup merge of #146415 - RalfJung:s390x-softfloat, r=workingjubilee
s390x: mark soft-float target feature as incompatible

This provides a more informative warning when someone manually sets `+soft-float` on s390x.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_target/src/target_features.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_target/src/target_features.rs b/compiler/rustc_target/src/target_features.rs
index 4c1b8c99426..dc70089c385 100644
--- a/compiler/rustc_target/src/target_features.rs
+++ b/compiler/rustc_target/src/target_features.rs
@@ -849,6 +849,7 @@ const IBMZ_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
     ("miscellaneous-extensions-3", Unstable(sym::s390x_target_feature), &[]),
     ("miscellaneous-extensions-4", Unstable(sym::s390x_target_feature), &[]),
     ("nnp-assist", Unstable(sym::s390x_target_feature), &["vector"]),
+    ("soft-float", Forbidden { reason: "currently unsupported ABI-configuration feature" }, &[]),
     ("transactional-execution", Unstable(sym::s390x_target_feature), &[]),
     ("vector", Unstable(sym::s390x_target_feature), &[]),
     ("vector-enhancements-1", Unstable(sym::s390x_target_feature), &["vector"]),
@@ -1177,6 +1178,13 @@ impl Target {
                     _ => unreachable!(),
                 }
             }
+            "s390x" => {
+                // We don't currently support a softfloat target on this architecture.
+                // As usual, we have to reject swapping the `soft-float` target feature.
+                // The "vector" target feature does not affect the ABI for floats
+                // because the vector and float registers overlap.
+                FeatureConstraints { required: &[], incompatible: &["soft-float"] }
+            }
             _ => NOTHING,
         }
     }