Skip to content

Commit

Permalink
disas/riscv: Make rv_op_illegal a shared enum value
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
cmuellner authored and alistair23 committed Jul 10, 2023
1 parent 5d326db commit 01b1361
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion disas/riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions disas/riscv.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ typedef struct {
const rvc_constraint *constraints;
} rv_comp_data;

enum {
rv_op_illegal = 0
};

enum {
rvcd_imm_nz = 0x1
};
Expand Down

0 comments on commit 01b1361

Please sign in to comment.