From f119a7b6ab464d89488767fd7235e85a52efeed2 Mon Sep 17 00:00:00 2001 From: luojia65 Date: Wed, 16 Mar 2022 16:57:36 +0800 Subject: [PATCH] feat: more RISC-V features These features include: - V for vector extension - Zfinx, Zdinx, Zhinx and Zhinxmin float in integer register extensions - Zfh, Zfhmin 16-bit float pointer extensions - Zbkb, Zkbc, Zbkc, Zk* cryptography extensions It matches name in LLVM feature and is_riscv_feature_detected!. --- .../rustc_codegen_ssa/src/target_features.rs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/compiler/rustc_codegen_ssa/src/target_features.rs b/compiler/rustc_codegen_ssa/src/target_features.rs index f37c675138177..ff7415af37339 100644 --- a/compiler/rustc_codegen_ssa/src/target_features.rs +++ b/compiler/rustc_codegen_ssa/src/target_features.rs @@ -223,6 +223,26 @@ const RISCV_ALLOWED_FEATURES: &[(&str, Option)] = &[ ("f", Some(sym::riscv_target_feature)), ("d", Some(sym::riscv_target_feature)), ("e", Some(sym::riscv_target_feature)), + ("v", Some(sym::riscv_target_feature)), + ("zfinx", Some(sym::riscv_target_feature)), + ("zdinx", Some(sym::riscv_target_feature)), + ("zhinx", Some(sym::riscv_target_feature)), + ("zhinxmin", Some(sym::riscv_target_feature)), + ("zfh", Some(sym::riscv_target_feature)), + ("zfhmin", Some(sym::riscv_target_feature)), + ("zbkb", Some(sym::riscv_target_feature)), + ("zbkc", Some(sym::riscv_target_feature)), + ("zbkx", Some(sym::riscv_target_feature)), + ("zknd", Some(sym::riscv_target_feature)), + ("zkne", Some(sym::riscv_target_feature)), + ("zknh", Some(sym::riscv_target_feature)), + ("zksed", Some(sym::riscv_target_feature)), + ("zksh", Some(sym::riscv_target_feature)), + ("zkr", Some(sym::riscv_target_feature)), + ("zkn", Some(sym::riscv_target_feature)), + ("zks", Some(sym::riscv_target_feature)), + ("zk", Some(sym::riscv_target_feature)), + ("zkt", Some(sym::riscv_target_feature)), ]; const WASM_ALLOWED_FEATURES: &[(&str, Option)] = &[