@@ -280,6 +280,7 @@ const AARCH64_FEATURES: &[(&str, StabilityUncomputed, ImpliedFeatures)] = &[
280
280
( "flagm" , STABLE , & [ ] ) ,
281
281
// FEAT_FLAGM2
282
282
( "flagm2" , unstable ( sym:: aarch64_unstable_target_feature) , & [ ] ) ,
283
+ ( "fp-armv8" , Stability :: Forbidden { reason : "Rust ties `fp-armv8` to `neon`" } , & [ ] ) ,
283
284
// FEAT_FP16
284
285
// Rust ties FP and Neon: https://github.com/rust-lang/rust/pull/91608
285
286
( "fp16" , STABLE , & [ "neon" ] ) ,
@@ -315,7 +316,28 @@ const AARCH64_FEATURES: &[(&str, StabilityUncomputed, ImpliedFeatures)] = &[
315
316
// FEAT_MTE & FEAT_MTE2
316
317
( "mte" , STABLE , & [ ] ) ,
317
318
// FEAT_AdvSimd & FEAT_FP
318
- ( "neon" , STABLE , & [ ] ) ,
319
+ (
320
+ "neon" ,
321
+ Stability :: Stable {
322
+ allow_toggle : |target, enable| {
323
+ if target. abi == "softfloat" {
324
+ // `neon` has no ABI implications for softfloat targets, we can allow this.
325
+ Ok ( ( ) )
326
+ } else if enable
327
+ && !target. has_neg_feature ( "fp-armv8" )
328
+ && !target. has_neg_feature ( "neon" )
329
+ {
330
+ // neon is enabled by default, and has not been disabled, so enabling it again
331
+ // is redundant and we can permit it. Forbidding this would be a breaking change
332
+ // since this feature is stable.
333
+ Ok ( ( ) )
334
+ } else {
335
+ Err ( "unsound on hard-float targets because it changes float ABI" )
336
+ }
337
+ } ,
338
+ } ,
339
+ & [ ] ,
340
+ ) ,
319
341
// FEAT_PAUTH (address authentication)
320
342
( "paca" , STABLE , & [ ] ) ,
321
343
// FEAT_PAUTH (generic authentication)
0 commit comments