Skip to content

Commit

Permalink
feat: more RISC-V features
Browse files Browse the repository at this point in the history
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!.
  • Loading branch information
luojia65 committed Mar 16, 2022
1 parent a2af9cf commit f119a7b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions compiler/rustc_codegen_ssa/src/target_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,26 @@ const RISCV_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
("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<Symbol>)] = &[
Expand Down

0 comments on commit f119a7b

Please sign in to comment.