gas/arc: Modify structure used to hold opcodes
authorAndrew Burgess <andrew.burgess@embecosm.com>
Mon, 28 Mar 2016 13:27:43 +0000 (14:27 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 7 Apr 2016 17:35:08 +0000 (18:35 +0100)
commitda5be03929920c8aed305f9ffac19ce37177b3c6
treea6470c609f5a3f5727677a97d5bb8892cfadfaf2
parentc8064e7e9b4d7d9cc29a613af899a7739df60be6
gas/arc: Modify structure used to hold opcodes

The arc assembler builds a hash table to hold references to arc_opcode
entries in the arc_opcodes table.  This hash assumes that each mnemonic
will always appear in a contiguous blocks within the arc_opcodes table;
all ADD instruction will be together, all AND instructions will likewise
be together and so on.

The problem with this is that as different variations of arc are added,
then it is often more convenient to split instructions apart, so all the
base ADD instructions are together, but, variants of ADD specific to one
variation of arc are grouped with other instructions specific to that
arc variant.  The current data structures don't support splitting the
instructions in this way.

This commit is a first step towards addressing this limitation.  In this
commit the hash table that currently holds arc_opcode pointers directly,
instead holds a pointer to a new, intermediate, data structure.  This
new data structure holds the pointer to the arc_opcode.  In this way, we
can, in the future support having the intermediate structure hold
multiple pointers to different arc_opcode groups.

There should be no visible functional change after this commit.

gas/ChangeLog:

* config/tc-arc.c (struct arc_opcode_hash_entry): New structure.
(arc_find_opcode): New function.
(find_special_case_pseudo): Use arc_find_opcode.
(find_special_case_flag): Likewise.
(assemble_tokens): Likewise.
(md_begin): Build hash using struct arc_opcode_hash_entry.
gas/ChangeLog
gas/config/tc-arc.c
This page took 0.024396 seconds and 4 git commands to generate.