@@ -582,6 +582,14 @@ pub fn all_rust_features() -> impl Iterator<Item = (&'static str, Stability)> {
582
582
const X86_FEATURES_FOR_CORRECT_VECTOR_ABI : & ' static [ ( u64 , & ' static str ) ] =
583
583
& [ ( 128 , "sse" ) , ( 256 , "avx" ) , ( 512 , "avx512f" ) ] ;
584
584
const AARCH64_FEATURES_FOR_CORRECT_VECTOR_ABI : & ' static [ ( u64 , & ' static str ) ] = & [ ( 128 , "neon" ) ] ;
585
+ const ARM_FEATURES_FOR_CORRECT_VECTOR_ABI : & ' static [ ( u64 , & ' static str ) ] = & [ ( 128 , "neon" ) ] ;
586
+ const POWERPC_FEATURES_FOR_CORRECT_VECTOR_ABI : & ' static [ ( u64 , & ' static str ) ] = & [ ( 128 , "altivec" ) ] ;
587
+ const WASM_FEATURES_FOR_CORRECT_VECTOR_ABI : & ' static [ ( u64 , & ' static str ) ] = & [ ( 128 , "simd128" ) ] ;
588
+ const S390X_FEATURES_FOR_CORRECT_VECTOR_ABI : & ' static [ ( u64 , & ' static str ) ] = & [ ( 128 , "vector" ) ] ;
589
+ // Always warn on RISCV and SPARC, as the necessary target features cannot be enabled in Rust at
590
+ // the moment.
591
+ const RISCV_FEATURES_FOR_CORRECT_VECTOR_ABI : & ' static [ ( u64 , & ' static str ) ] = & [ ] ;
592
+ const SPARC_FEATURES_FOR_CORRECT_VECTOR_ABI : & ' static [ ( u64 , & ' static str ) ] = & [ ] ;
585
593
586
594
impl super :: spec:: Target {
587
595
pub fn rust_target_features ( & self ) -> & ' static [ ( & ' static str , Stability , ImpliedFeatures ) ] {
@@ -606,9 +614,19 @@ impl super::spec::Target {
606
614
// Returns None if we do not support ABI checks on the given target yet.
607
615
pub fn features_for_correct_vector_abi ( & self ) -> Option < & ' static [ ( u64 , & ' static str ) ] > {
608
616
match & * self . arch {
617
+ // Tier 1
609
618
"x86" | "x86_64" => Some ( X86_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
610
619
"aarch64" => Some ( AARCH64_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
611
- // FIXME: add support for non-tier1 architectures
620
+ // Tier 2
621
+ "arm64ec" => Some ( AARCH64_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
622
+ "arm" => Some ( ARM_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
623
+ "powerpc" | "powerpc64" => Some ( POWERPC_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
624
+ "loongarch64" => Some ( & [ ] ) , // on-stack ABI, so we complain about all by-val vectors
625
+ "riscv32" | "riscv64" => Some ( RISCV_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
626
+ "wasm32" | "wasm64" => Some ( WASM_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
627
+ "s390x" => Some ( S390X_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
628
+ "sparc" | "sparc64" => Some ( SPARC_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
629
+ // FIXME: add support for non-tier2 architectures
612
630
_ => None ,
613
631
}
614
632
}
0 commit comments