Skip to contentSkip to conversation

target/xtensa: make opcode properties more dynamic

PATCH New Max Filippov 1 participant 1 message Jun 27, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/xtensa: make opcode properties more dynamic

There's XtensaOpcodeOps::test_ill that is used to check whether opcode generates illegal opcode exception or not. The illegal opcode exception is not special and so this callback can be generalized to provide any XTENSA_OP_* flags that are not completely static.
Introduce XtensaOpcodeOps::test_exceptions and convert all test_ill users to test_exceptions.

---
 target/xtensa/cpu.h       |   5 +-
 target/xtensa/translate.c | 538 ++++++++++++++++++++------------------
 2 files changed, 278 insertions(+), 265 deletions(-)
target/xtensa/cpu.h +1 -4
index 32749378bfc7..65f00028501a 100644
@@ -364,9 +364,6 @@ typedef struct opcode_arg {
 typedef struct DisasContext DisasContext;
 typedef void (*XtensaOpcodeOp)(DisasContext *dc, const OpcodeArg arg[],
                                const uint32_t par[]);
-typedef bool (*XtensaOpcodeBoolTest)(DisasContext *dc,
-                                     const OpcodeArg arg[],
-                                     const uint32_t par[]);
 typedef uint32_t (*XtensaOpcodeUintTest)(DisasContext *dc,
                                          const OpcodeArg arg[],
                                          const uint32_t par[]);
@@ -408,7 +405,7 @@ enum {
 typedef struct XtensaOpcodeOps {
     const void *name;
     XtensaOpcodeOp translate;
-    XtensaOpcodeBoolTest test_ill;
+    XtensaOpcodeUintTest test_exceptions;
     XtensaOpcodeUintTest test_overflow;
     const uint32_t *par;
     uint32_t op_flags;
target/xtensa/translate.c +277 -261

2,016 lines not on this page · raw message

Signature · 1 line
2.20.1