@@ -290,6 +290,7 @@ const AARCH64_FEATURES: &[(&str, StabilityUncomputed, ImpliedFeatures)] = &[
290290 ( "flagm" , STABLE , & [ ] ) ,
291291 // FEAT_FLAGM2
292292 ( "flagm2" , unstable ( sym:: aarch64_unstable_target_feature) , & [ ] ) ,
293+ ( "fp-armv8" , Stability :: Forbidden { reason : "Rust ties `fp-armv8` to `neon`" } , & [ ] ) ,
293294 // FEAT_FP16
294295 // Rust ties FP and Neon: https://github.com/rust-lang/rust/pull/91608
295296 ( "fp16" , STABLE , & [ "neon" ] ) ,
@@ -325,7 +326,28 @@ const AARCH64_FEATURES: &[(&str, StabilityUncomputed, ImpliedFeatures)] = &[
325326 // FEAT_MTE & FEAT_MTE2
326327 ( "mte" , STABLE , & [ ] ) ,
327328 // FEAT_AdvSimd & FEAT_FP
328- ( "neon" , STABLE , & [ ] ) ,
329+ (
330+ "neon" ,
331+ Stability :: Stable {
332+ allow_toggle : |target, enable| {
333+ if target. abi == "softfloat" {
334+ // `neon` has no ABI implications for softfloat targets, we can allow this.
335+ Ok ( ( ) )
336+ } else if enable
337+ && !target. has_neg_feature ( "fp-armv8" )
338+ && !target. has_neg_feature ( "neon" )
339+ {
340+ // neon is enabled by default, and has not been disabled, so enabling it again
341+ // is redundant and we can permit it. Forbidding this would be a breaking change
342+ // since this feature is stable.
343+ Ok ( ( ) )
344+ } else {
345+ Err ( "unsound on hard-float targets because it changes float ABI" )
346+ }
347+ } ,
348+ } ,
349+ & [ ] ,
350+ ) ,
329351 // FEAT_PAUTH (address authentication)
330352 ( "paca" , STABLE , & [ ] ) ,
331353 // FEAT_PAUTH (generic authentication)
0 commit comments