/* aarch64-gen.c -- Generate tables and routines for opcode lookup and
instruction encoding and decoding.
- Copyright (C) 2012-2015 Free Software Foundation, Inc.
+ Copyright (C) 2012-2016 Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of the GNU opcodes library.
is decided to be undividable and OPCODE will be assigned to BITTREE->LIST.
The function recursively call itself until OPCODE is undividable.
-
+
N.B. the nature of this algrithm determines that given any value in the
32-bit space, the computed decision tree will always be able to find one or
more opcodes entries for it, regardless whether there is a valid instruction
find_alias_opcode (const aarch64_opcode *opcode)
{
int i;
- /* Assume maximum of 8 disassemble preference candidates. */
- const int max_num_aliases = 8;
+ /* Assume maximum of 16 disassemble preference candidates. */
+ const int max_num_aliases = 16;
const aarch64_opcode *ent;
- const aarch64_opcode *preferred[max_num_aliases];
+ const aarch64_opcode *preferred[max_num_aliases + 1];
opcode_node head, **next;
assert (opcode_has_alias (opcode));
i = 0;
+ if (opcode->name != NULL)
+ preferred[i++] = opcode;
ent = aarch64_opcode_table;
while (ent->name != NULL)
{
print_divide_result (decoder_tree);
printf ("/* This file is automatically generated by aarch64-gen. Do not edit! */\n");
- printf ("/* Copyright (C) 2012-2015 Free Software Foundation, Inc.\n\
+ printf ("/* Copyright (C) 2012-2016 Free Software Foundation, Inc.\n\
Contributed by ARM Ltd.\n\
\n\
This file is part of the GNU opcodes library.\n\