Skip to content

Commit c9769e8

Browse files
committed
arm: add unstable soft-float target feature
1 parent 243d2ca commit c9769e8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

compiler/rustc_target/src/target_features.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ const ARM_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
148148
("neon", Unstable(sym::arm_target_feature), &["vfp3"]),
149149
("rclass", Unstable(sym::arm_target_feature), &[]),
150150
("sha2", Unstable(sym::arm_target_feature), &["neon"]),
151+
// This can be *disabled* on non-`hf` targets to enable the use
152+
// of hardfloats while keeping the softfloat ABI.
153+
// FIXME before stabilization: Should we expose this as a `hard-float` target feature instead of
154+
// matching the odd negative feature LLVM uses?
155+
("soft-float", Unstable(sym::arm_target_feature), &[]),
151156
// This is needed for inline assembly, but shouldn't be stabilized as-is
152157
// since it should be enabled per-function using #[instruction_set], not
153158
// #[target_feature].
@@ -790,6 +795,9 @@ impl Target {
790795
match self.llvm_floatabi.unwrap() {
791796
FloatAbi::Soft => {
792797
// Nothing special required, will use soft-float ABI throughout.
798+
// We can even allow `-soft-float` here; in fact that is useful as it lets
799+
// people use FPU instructions with a softfloat ABI (corresponds to
800+
// `-mfloat-abi=softfp` in GCC/clang).
793801
NOTHING
794802
}
795803
FloatAbi::Hard => {

0 commit comments

Comments
 (0)