@@ -290,6 +290,7 @@ const AARCH64_FEATURES: &[(&str, StabilityUncomputed, ImpliedFeatures)] = &[
290
290
( "flagm" , STABLE , & [ ] ) ,
291
291
// FEAT_FLAGM2
292
292
( "flagm2" , unstable ( sym:: aarch64_unstable_target_feature) , & [ ] ) ,
293
+ ( "fp-armv8" , Stability :: Forbidden { reason : "Rust ties `fp-armv8` to `neon`" } , & [ ] ) ,
293
294
// FEAT_FP16
294
295
// Rust ties FP and Neon: https://github.com/rust-lang/rust/pull/91608
295
296
( "fp16" , STABLE , & [ "neon" ] ) ,
@@ -325,7 +326,28 @@ const AARCH64_FEATURES: &[(&str, StabilityUncomputed, ImpliedFeatures)] = &[
325
326
// FEAT_MTE & FEAT_MTE2
326
327
( "mte" , STABLE , & [ ] ) ,
327
328
// 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
+ ) ,
329
351
// FEAT_PAUTH (address authentication)
330
352
( "paca" , STABLE , & [ ] ) ,
331
353
// FEAT_PAUTH (generic authentication)
0 commit comments