RISC-V: Support to add implicit extensions for G.
[binutils-gdb.git] / include / opcode / riscv.h
index ba993e7d34dd621bcb8da31bfbbadab7a9633a80..680780a664e28e983900b9dc2e933ce3664e8f81 100644 (file)
@@ -204,7 +204,7 @@ static const char * const riscv_pred_succ[16] =
 #define OP_SH_RS2              20
 #define OP_MASK_RS1            0x1f
 #define OP_SH_RS1              15
-#define OP_MASK_RS3            0x1f
+#define OP_MASK_RS3            0x1fU
 #define OP_SH_RS3              27
 #define OP_MASK_RD             0x1f
 #define OP_SH_RD               7
@@ -223,14 +223,14 @@ static const char * const riscv_pred_succ[16] =
 #define OP_MASK_RL             0x1
 #define OP_SH_RL               25
 
-#define OP_MASK_CUSTOM_IMM     0x7f
+#define OP_MASK_CUSTOM_IMM     0x7fU
 #define OP_SH_CUSTOM_IMM       25
-#define OP_MASK_CSR            0xfff
+#define OP_MASK_CSR            0xfffU
 #define OP_SH_CSR              20
 
 #define OP_MASK_FUNCT3         0x7
 #define OP_SH_FUNCT3           12
-#define OP_MASK_FUNCT7         0x7f
+#define OP_MASK_FUNCT7         0x7fU
 #define OP_SH_FUNCT7           25
 #define OP_MASK_FUNCT2         0x3
 #define OP_SH_FUNCT2           25
@@ -354,14 +354,16 @@ enum riscv_isa_spec_class
   ISA_SPEC_CLASS_20191213
 };
 
+#define RISCV_UNKNOWN_VERSION -1
+
 /* This structure holds version information for specific ISA.  */
 
 struct riscv_ext_version
 {
   const char *name;
   enum riscv_isa_spec_class isa_spec_class;
-  unsigned int major_version;
-  unsigned int minor_version;
+  int major_version;
+  int minor_version;
 };
 
 /* All RISC-V CSR belong to one of these classes.  */
@@ -373,6 +375,7 @@ enum riscv_csr_class
   CSR_CLASS_I,
   CSR_CLASS_I_32,      /* rv32 only */
   CSR_CLASS_F,         /* f-ext only */
+  CSR_CLASS_DEBUG      /* debug CSR */
 };
 
 /* The current supported privilege spec versions.  */