diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2019-02-09 23:21:44 -0800 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2019-02-18 21:29:08 -0800 |
commit | 759039737504c3f11098f7240c6048c6279e2215 (patch) | |
tree | bdedf02668294fdfc0d1bd5f5aa9894ee2f6d3bd /target/xtensa/translate.c | |
parent | 0e7c887919e44f25491a4eb86403e947d9d54937 (diff) |
target/xtensa: don't require opcode table sorting
Requirement for alphabetical opcode sorting in opcode tables is awkward
and does not allow sharing implementation between multiple opcodes.
Use hash tables to find opcodes by name. Move implementation from the
translate.c to the helper.c to its only user and remove declaration from
the cpu.h
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'target/xtensa/translate.c')
-rw-r--r-- | target/xtensa/translate.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index 62283cd1cc..26342aaa1f 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -1274,20 +1274,6 @@ void restore_state_to_opc(CPUXtensaState *env, TranslationBlock *tb, env->pc = data[0]; } -static int compare_opcode_ops(const void *a, const void *b) -{ - return strcmp((const char *)a, - ((const XtensaOpcodeOps *)b)->name); -} - -XtensaOpcodeOps * -xtensa_find_opcode_ops(const XtensaOpcodeTranslators *t, - const char *name) -{ - return bsearch(name, t->opcode, t->num_opcodes, - sizeof(XtensaOpcodeOps), compare_opcode_ops); -} - static void translate_abs(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { |