aboutsummaryrefslogtreecommitdiff
path: root/include/opcode/riscv.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/opcode/riscv.h')
-rw-r--r--include/opcode/riscv.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/opcode/riscv.h b/include/opcode/riscv.h
index 739d6da..808f365 100644
--- a/include/opcode/riscv.h
+++ b/include/opcode/riscv.h
@@ -108,6 +108,10 @@ static inline unsigned int riscv_insn_length (insn_t insn)
(RV_X(x, 20, 10))
#define EXTRACT_RVV_VC_IMM(x) \
(RV_X(x, 20, 11))
+#define EXTRACT_ZCB_BYTE_UIMM(x) \
+ (RV_X(x, 6, 1) | (RV_X(x, 5, 1) << 1))
+#define EXTRACT_ZCB_HALFWORD_UIMM(x) \
+ (RV_X(x, 5, 1) << 1)
#define ENCODE_ITYPE_IMM(x) \
(RV_X(x, 0, 12) << 20)
@@ -155,6 +159,10 @@ static inline unsigned int riscv_insn_length (insn_t insn)
(RV_X(x, 0, 11) << 20)
#define ENCODE_RVV_VI_UIMM6(x) \
(RV_X(x, 0, 5) << 15 | RV_X(x, 5, 1) << 26)
+#define ENCODE_ZCB_BYTE_UIMM(x) \
+ ((RV_X(x, 0, 1) << 6) | (RV_X(x, 1, 1) << 5))
+#define ENCODE_ZCB_HALFWORD_UIMM(x) \
+ (RV_X(x, 1, 1) << 5)
#define VALID_ITYPE_IMM(x) (EXTRACT_ITYPE_IMM(ENCODE_ITYPE_IMM(x)) == (x))
#define VALID_STYPE_IMM(x) (EXTRACT_STYPE_IMM(ENCODE_STYPE_IMM(x)) == (x))
@@ -180,6 +188,8 @@ static inline unsigned int riscv_insn_length (insn_t insn)
#define VALID_CJTYPE_IMM(x) (EXTRACT_CJTYPE_IMM(ENCODE_CJTYPE_IMM(x)) == (x))
#define VALID_RVV_VB_IMM(x) (EXTRACT_RVV_VB_IMM(ENCODE_RVV_VB_IMM(x)) == (x))
#define VALID_RVV_VC_IMM(x) (EXTRACT_RVV_VC_IMM(ENCODE_RVV_VC_IMM(x)) == (x))
+#define VALID_ZCB_BYTE_UIMM(x) (EXTRACT_ZCB_BYTE_UIMM(ENCODE_ZCB_BYTE_UIMM(x)) == (x))
+#define VALID_ZCB_HALFWORD_UIMM(x) (EXTRACT_ZCB_HALFWORD_UIMM(ENCODE_ZCB_HALFWORD_UIMM(x)) == (x))
#define RISCV_RTYPE(insn, rd, rs1, rs2) \
((MATCH_ ## insn) | ((rd) << OP_SH_RD) | ((rs1) << OP_SH_RS1) | ((rs2) << OP_SH_RS2))
@@ -421,6 +431,10 @@ enum riscv_insn_class
INSN_CLASS_ZVKNHA_OR_ZVKNHB,
INSN_CLASS_ZVKSED,
INSN_CLASS_ZVKSH,
+ INSN_CLASS_ZCB,
+ INSN_CLASS_ZCB_AND_ZBA,
+ INSN_CLASS_ZCB_AND_ZBB,
+ INSN_CLASS_ZCB_AND_ZMMUL,
INSN_CLASS_SVINVAL,
INSN_CLASS_ZICBOM,
INSN_CLASS_ZICBOP,