@@ -582,6 +582,13 @@ pub fn all_rust_features() -> impl Iterator<Item = (&'static str, Stability)> {
582582const X86_FEATURES_FOR_CORRECT_VECTOR_ABI : & ' static [ ( u64 , & ' static str ) ] =
583583 & [ ( 128 , "sse" ) , ( 256 , "avx" ) , ( 512 , "avx512f" ) ] ;
584584const 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 RISCV_FEATURES_FOR_CORRECT_VECTOR_ABI : & ' static [ ( u64 , & ' static str ) ] =
588+ & [ ( 32 , "zve32x" ) , ( 64 , "zve64x" ) , ( 128 , "zvl128b" ) ] ;
589+ const WASM_FEATURES_FOR_CORRECT_VECTOR_ABI : & ' static [ ( u64 , & ' static str ) ] = & [ ( 128 , "simd128" ) ] ;
590+ const S390X_FEATURES_FOR_CORRECT_VECTOR_ABI : & ' static [ ( u64 , & ' static str ) ] = & [ ( 128 , "vector" ) ] ;
591+ const SPARC_FEATURES_FOR_CORRECT_VECTOR_ABI : & ' static [ ( u64 , & ' static str ) ] = & [ ( 64 , "v9" ) ] ;
585592
586593impl super :: spec:: Target {
587594 pub fn rust_target_features ( & self ) -> & ' static [ ( & ' static str , Stability , ImpliedFeatures ) ] {
@@ -606,9 +613,18 @@ impl super::spec::Target {
606613 // Returns None if we do not support ABI checks on the given target yet.
607614 pub fn features_for_correct_vector_abi ( & self ) -> Option < & ' static [ ( u64 , & ' static str ) ] > {
608615 match & * self . arch {
616+ // Tier 1
609617 "x86" | "x86_64" => Some ( X86_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
610618 "aarch64" => Some ( AARCH64_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
611- // FIXME: add support for non-tier1 architectures
619+ // Tier 2
620+ "arm" => Some ( ARM_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
621+ "powerpc" | "powerpc64" => Some ( POWERPC_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
622+ "loongarch" => Some ( & [ ] ) , // on-stack ABI, so we complain about all by-val vectors
623+ "riscv32" | "riscv64" => Some ( RISCV_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
624+ "wasm32" | "wasm64" => Some ( WASM_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
625+ "s390x" => Some ( S390X_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
626+ "sparc" | "sparc64" => Some ( SPARC_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
627+ // FIXME: add support for non-tier2 architectures
612628 _ => None ,
613629 }
614630 }
0 commit comments