disas/riscv: Make rv_op_illegal a shared enum value
authorChristoph Müllner <christoph.muellner@vrull.eu>
Mon, 12 Jun 2023 11:10:30 +0000 (13:10 +0200)
committerAlistair Francis <alistair.francis@wdc.com>
Mon, 10 Jul 2023 12:29:14 +0000 (22:29 +1000)
The enum value 'rv_op_illegal' does not represent an
instruction, but is a catch-all value in case we have
no match in the decoder. Let's make the value a shared
one, so that other compile units can reuse it.

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Message-Id: <20230612111034.3955227-5-christoph.muellner@vrull.eu>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
disas/riscv.c
disas/riscv.h

index 4a55348267799d99f42f7c1ec79f95de4d88fb9a..b6ced2a26a7fddd0358b9c7bf52959be2a92a716 100644 (file)
@@ -23,7 +23,7 @@
 #include "disas/riscv.h"
 
 typedef enum {
-    rv_op_illegal = 0,
+    /* 0 is reserved for rv_op_illegal. */
     rv_op_lui = 1,
     rv_op_auipc = 2,
     rv_op_jal = 3,
index 9288255915f5d9a58f06b741a357fb1b33f2afea..debbe692399eacce5e4c2f5bb16f90916dff9bcd 100644 (file)
@@ -191,6 +191,10 @@ typedef struct {
     const rvc_constraint *constraints;
 } rv_comp_data;
 
+enum {
+    rv_op_illegal = 0
+};
+
 enum {
     rvcd_imm_nz = 0x1
 };