summaryrefslogtreecommitdiff
path: root/opcodes/i386-gen.c
diff options
context:
space:
mode:
Diffstat (limited to 'opcodes/i386-gen.c')
-rw-r--r--opcodes/i386-gen.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/opcodes/i386-gen.c b/opcodes/i386-gen.c
index f14384231d6..5f68f933f15 100644
--- a/opcodes/i386-gen.c
+++ b/opcodes/i386-gen.c
@@ -1703,7 +1703,7 @@ process_i386_opcodes (FILE *table)
{
FILE *fp;
char buf[2048];
- unsigned int i, j;
+ unsigned int i, j, nr;
char *str, *p, *last, *name;
htab_t opcode_hash_table;
struct opcode_hash_entry **opcode_array = NULL;
@@ -1819,6 +1819,26 @@ process_i386_opcodes (FILE *table)
fclose (fp);
fprintf (table, "};\n");
+
+ /* Generate opcode sets array. */
+ fprintf (table, "\n/* i386 opcode sets table. */\n\n");
+ fprintf (table, "static const insn_template *const i386_op_sets[] =\n{\n");
+ fprintf (table, " i386_optab,\n");
+
+ for (nr = j = 0; j < i; j++)
+ {
+ struct opcode_hash_entry *next = opcode_array[j];
+
+ do
+ {
+ ++nr;
+ next = next->next;
+ }
+ while (next);
+ fprintf (table, " i386_optab + %u,\n", nr);
+ }
+
+ fprintf (table, "};\n");
}
static void