@@ -582,6 +582,12 @@ 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 POWERPC_FEATURES_FOR_CORRECT_VECTOR_ABI : & ' static [ ( u64 , & ' static str ) ] = & [ ( 128 , "altivec" ) ] ;
586
+ const RISCV_FEATURES_FOR_CORRECT_VECTOR_ABI : & ' static [ ( u64 , & ' static str ) ] =
587
+ & [ ( 32 , "zve32x" ) , ( 64 , "zve64x" ) , ( 128 , "zvl128b" ) ] ;
588
+ const WASM_FEATURES_FOR_CORRECT_VECTOR_ABI : & ' static [ ( u64 , & ' static str ) ] = & [ ( 128 , "simd128" ) ] ;
589
+ const S390X_FEATURES_FOR_CORRECT_VECTOR_ABI : & ' static [ ( u64 , & ' static str ) ] = & [ ( 128 , "vector" ) ] ;
590
+ const SPARC_FEATURES_FOR_CORRECT_VECTOR_ABI : & ' static [ ( u64 , & ' static str ) ] = & [ ( 64 , "v9" ) ] ;
585
591
586
592
impl super :: spec:: Target {
587
593
pub fn rust_target_features ( & self ) -> & ' static [ ( & ' static str , Stability , ImpliedFeatures ) ] {
@@ -607,8 +613,14 @@ impl super::spec::Target {
607
613
pub fn features_for_correct_vector_abi ( & self ) -> Option < & ' static [ ( u64 , & ' static str ) ] > {
608
614
match & * self . arch {
609
615
"x86" | "x86_64" => Some ( X86_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
610
- "aarch64" => Some ( AARCH64_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
611
- // FIXME: add support for non-tier1 architectures
616
+ "arm" | "aarch64" => Some ( AARCH64_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
617
+ "powerpc" | "powerpc64" => Some ( POWERPC_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
618
+ "loongarch" => Some ( & [ ] ) , // on-stack ABI, should never pass-by-vec.
619
+ "riscv32" | "riscv64" => Some ( RISCV_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
620
+ "wasm32" | "wasm64" => Some ( WASM_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
621
+ "s390x" => Some ( S390X_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
622
+ "sparc" | "sparc64" => Some ( SPARC_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
623
+ // FIXME: add support for non-tier2 architectures
612
624
_ => None ,
613
625
}
614
626
}
0 commit comments