diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2018-08-27 21:43:43 -0700 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2018-10-01 11:08:35 -0700 |
commit | 0946097051713031db1ff884c67081f291210ee2 (patch) | |
tree | 03c08eefabed09081c92d6cf54f611b08f6e6c75 /target/xtensa/helper.c | |
parent | c5e4e49258e9b89cb34c085a419dd9f862935c48 (diff) |
target/xtensa: extract test for an illegal instruction
- TB flags: add XTENSA_TBFLAG_CWOE that corresponds to the architectural
CWOE state;
- entry: move CWOE check from the helper to the test_ill_entry;
- retw: move CWOE check from the helper to the test_ill_retw;
- separate instruction disassembly loop and translation loop; save
disassembly results in local array;
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'target/xtensa/helper.c')
-rw-r--r-- | target/xtensa/helper.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/target/xtensa/helper.c b/target/xtensa/helper.c index 4fceb4424a..501082f55b 100644 --- a/target/xtensa/helper.c +++ b/target/xtensa/helper.c @@ -57,12 +57,18 @@ static void init_libisa(XtensaConfig *config) { unsigned i, j; unsigned opcodes; + unsigned formats; config->isa = xtensa_isa_init(config->isa_internal, NULL, NULL); assert(xtensa_isa_maxlength(config->isa) <= MAX_INSN_LENGTH); opcodes = xtensa_isa_num_opcodes(config->isa); + formats = xtensa_isa_num_formats(config->isa); config->opcode_ops = g_new(XtensaOpcodeOps *, opcodes); + for (i = 0; i < formats; ++i) { + assert(xtensa_format_num_slots(config->isa, i) <= MAX_INSN_SLOTS); + } + for (i = 0; i < opcodes; ++i) { const char *opc_name = xtensa_opcode_name(config->isa, i); XtensaOpcodeOps *ops = NULL; |