[15/21,crypto] : add option defines for Zkr and Zkt

Message ID 20211031093445.1414518-16-siyu@isrc.iscas.ac.cn
State New
Headers
Series RISC-V: add gcc support for Scalar Cryptography v1.0.0-rc5 |

Commit Message

siyu@isrc.iscas.ac.cn Oct. 31, 2021, 9:34 a.m. UTC
  From: SiYu Wu <siyu@isrc.iscas.ac.cn>

---
 gcc/common/config/riscv/riscv-common.c | 3 +++
 gcc/config/riscv/riscv-opts.h          | 3 +++
 2 files changed, 6 insertions(+)
  

Patch

diff --git a/gcc/common/config/riscv/riscv-common.c b/gcc/common/config/riscv/riscv-common.c
index 8f4f4472690..b2b85180ffe 100644
--- a/gcc/common/config/riscv/riscv-common.c
+++ b/gcc/common/config/riscv/riscv-common.c
@@ -109,8 +109,10 @@  static const struct riscv_ext_version riscv_ext_version_table[] =
   {"zkne",  ISA_SPEC_CLASS_NONE, 1, 0},
   {"zknd",  ISA_SPEC_CLASS_NONE, 1, 0},
   {"zknh",  ISA_SPEC_CLASS_NONE, 1, 0},
+  {"zkr",   ISA_SPEC_CLASS_NONE, 1, 0},
   {"zksed", ISA_SPEC_CLASS_NONE, 1, 0},
   {"zksh",  ISA_SPEC_CLASS_NONE, 1, 0},
+  {"zkt",   ISA_SPEC_CLASS_NONE, 1, 0},
 
   /* Terminate the list.  */
   {NULL, ISA_SPEC_CLASS_NONE, 0, 0}
@@ -927,6 +929,7 @@  static const riscv_ext_flag_table_t riscv_ext_flag_table[] =
   {"zknh",   &gcc_options::x_riscv_zk_subext, MASK_ZKNH},
   {"zksed",  &gcc_options::x_riscv_zk_subext, MASK_ZKSED},
   {"zksh",   &gcc_options::x_riscv_zk_subext, MASK_ZKSH},
+  {"zkt",    &gcc_options::x_riscv_zk_subext, MASK_ZKT},
 
   {NULL, NULL, 0}
 };
diff --git a/gcc/config/riscv/riscv-opts.h b/gcc/config/riscv/riscv-opts.h
index dafcf1f591f..df254d1015e 100644
--- a/gcc/config/riscv/riscv-opts.h
+++ b/gcc/config/riscv/riscv-opts.h
@@ -86,13 +86,16 @@  enum stack_protector_guard {
 #define MASK_ZKNE     (1 << 5)
 #define MASK_ZKND     (1 << 6)
 #define MASK_ZKNH     (1 << 7)
+#define MASK_ZKR      (1 << 8)
 #define MASK_ZKSED    (1 << 9)
 #define MASK_ZKSH     (1 << 10)
+#define MASK_ZKT      (1 << 11)
 
 #define TARGET_ZKNE   ((riscv_zk_subext & MASK_ZKNE) != 0)
 #define TARGET_ZKND   ((riscv_zk_subext & MASK_ZKND) != 0)
 #define TARGET_ZKNH   ((riscv_zk_subext & MASK_ZKNH) != 0)
 #define TARGET_ZKSED  ((riscv_zk_subext & MASK_ZKSED) != 0)
 #define TARGET_ZKSH   ((riscv_zk_subext & MASK_ZKSH) != 0)
+#define TARGET_ZKT    ((riscv_zk_subext & MASK_ZKT) != 0)
 
 #endif /* ! GCC_RISCV_OPTS_H */