@@ -598,7 +598,12 @@ const S390X_FEATURES_FOR_CORRECT_VECTOR_ABI: &'static [(u64, &'static str)] = &[
598598const RISCV_FEATURES_FOR_CORRECT_VECTOR_ABI : & ' static [ ( u64 , & ' static str ) ] =
599599 & [ /*(64, "zvl64b"), */ ( 128 , "v" ) ] ;
600600// Always warn on SPARC, as the necessary target features cannot be enabled in Rust at the moment.
601- const SPARC_FEATURES_FOR_CORRECT_VECTOR_ABI : & ' static [ ( u64 , & ' static str ) ] = & [ /*(128, "vis")*/ ] ;
601+ const SPARC_FEATURES_FOR_CORRECT_VECTOR_ABI : & ' static [ ( u64 , & ' static str ) ] = & [ /*(64, "vis")*/ ] ;
602+
603+ const HEXAGON_FEATURES_FOR_CORRECT_VECTOR_ABI : & ' static [ ( u64 , & ' static str ) ] =
604+ & [ /*(512, "hvx-length64b"),*/ ( 1024 , "hvx-length128b" ) ] ;
605+ const MIPS_FEATURES_FOR_CORRECT_VECTOR_ABI : & ' static [ ( u64 , & ' static str ) ] = & [ ( 128 , "msa" ) ] ;
606+ const CSKY_FEATURES_FOR_CORRECT_VECTOR_ABI : & ' static [ ( u64 , & ' static str ) ] = & [ ( 128 , "vdspv1" ) ] ;
602607
603608impl super :: spec:: Target {
604609 pub fn rust_target_features ( & self ) -> & ' static [ ( & ' static str , Stability , ImpliedFeatures ) ] {
@@ -620,20 +625,24 @@ impl super::spec::Target {
620625 }
621626 }
622627
623- // Returns None if we do not support ABI checks on the given target yet.
624- pub fn features_for_correct_vector_abi ( & self ) -> Option < & ' static [ ( u64 , & ' static str ) ] > {
628+ pub fn features_for_correct_vector_abi ( & self ) -> & ' static [ ( u64 , & ' static str ) ] {
625629 match & * self . arch {
626- "x86" | "x86_64" => Some ( X86_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
627- "aarch64" | "arm64ec" => Some ( AARCH64_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
628- "arm" => Some ( ARM_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
629- "powerpc" | "powerpc64" => Some ( POWERPC_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
630- "loongarch64" => Some ( & [ ] ) , // on-stack ABI, so we complain about all by-val vectors
631- "riscv32" | "riscv64" => Some ( RISCV_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
632- "wasm32" | "wasm64" => Some ( WASM_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
633- "s390x" => Some ( S390X_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
634- "sparc" | "sparc64" => Some ( SPARC_FEATURES_FOR_CORRECT_VECTOR_ABI ) ,
635- // FIXME: add support for non-tier2 architectures
636- _ => None ,
630+ "x86" | "x86_64" => X86_FEATURES_FOR_CORRECT_VECTOR_ABI ,
631+ "aarch64" | "arm64ec" => AARCH64_FEATURES_FOR_CORRECT_VECTOR_ABI ,
632+ "arm" => ARM_FEATURES_FOR_CORRECT_VECTOR_ABI ,
633+ "powerpc" | "powerpc64" => POWERPC_FEATURES_FOR_CORRECT_VECTOR_ABI ,
634+ "loongarch64" => & [ ] , // on-stack ABI, so we complain about all by-val vectors
635+ "riscv32" | "riscv64" => RISCV_FEATURES_FOR_CORRECT_VECTOR_ABI ,
636+ "wasm32" | "wasm64" => WASM_FEATURES_FOR_CORRECT_VECTOR_ABI ,
637+ "s390x" => S390X_FEATURES_FOR_CORRECT_VECTOR_ABI ,
638+ "sparc" | "sparc64" => SPARC_FEATURES_FOR_CORRECT_VECTOR_ABI ,
639+ "hexagon" => HEXAGON_FEATURES_FOR_CORRECT_VECTOR_ABI ,
640+ "mips" | "mips32r6" | "mips64" | "mips64r6" => MIPS_FEATURES_FOR_CORRECT_VECTOR_ABI ,
641+ "bpf" => & [ ] , // no vector ABI
642+ "csky" => CSKY_FEATURES_FOR_CORRECT_VECTOR_ABI ,
643+ // FIXME: for some tier3 targets, we are overly cautious and always give warnings
644+ // when passing args in vector registers.
645+ _ => & [ ] ,
637646 }
638647 }
639648
0 commit comments