From 8a6f96a4a08df2bbb73ffbb7afb9b94f137bd24b Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Thu, 20 Mar 2025 19:48:02 +0900 Subject: [PATCH] rustc_target: Use zvl*b target features in vector ABI check --- compiler/rustc_target/src/target_features.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_target/src/target_features.rs b/compiler/rustc_target/src/target_features.rs index e1865c624c4..0e6523f0880 100644 --- a/compiler/rustc_target/src/target_features.rs +++ b/compiler/rustc_target/src/target_features.rs @@ -740,8 +740,20 @@ const ARM_FEATURES_FOR_CORRECT_VECTOR_ABI: &'static [(u64, &'static str)] = &[(1 const POWERPC_FEATURES_FOR_CORRECT_VECTOR_ABI: &'static [(u64, &'static str)] = &[(128, "altivec")]; const WASM_FEATURES_FOR_CORRECT_VECTOR_ABI: &'static [(u64, &'static str)] = &[(128, "simd128")]; const S390X_FEATURES_FOR_CORRECT_VECTOR_ABI: &'static [(u64, &'static str)] = &[(128, "vector")]; -const RISCV_FEATURES_FOR_CORRECT_VECTOR_ABI: &'static [(u64, &'static str)] = - &[/*(64, "zvl64b"), */ (128, "v")]; +const RISCV_FEATURES_FOR_CORRECT_VECTOR_ABI: &'static [(u64, &'static str)] = &[ + (32, "zvl32b"), + (64, "zvl64b"), + (128, "zvl128b"), + (256, "zvl256b"), + (512, "zvl512b"), + (1024, "zvl1024b"), + (2048, "zvl2048b"), + (4096, "zvl4096b"), + (8192, "zvl8192b"), + (16384, "zvl16384b"), + (32768, "zvl32768b"), + (65536, "zvl65536b"), +]; // Always warn on SPARC, as the necessary target features cannot be enabled in Rust at the moment. const SPARC_FEATURES_FOR_CORRECT_VECTOR_ABI: &'static [(u64, &'static str)] = &[/*(64, "vis")*/];