diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2016-07-06 19:39:55 +0100 |
---|---|---|
committer | Graham Markall <graham.markall@embecosm.com> | 2016-11-03 17:14:38 +0000 |
commit | bdfe53e3cfebb392b1a0ef50fdd02faafec6dc63 (patch) | |
tree | cecbcc406b11fa238f68c776cc67b130027e9f6a /opcodes/arc-ext.c | |
parent | 90f61cceac73fe40dcd21b3590c247bfa624ac00 (diff) | |
download | gdb-bdfe53e3cfebb392b1a0ef50fdd02faafec6dc63.zip gdb-bdfe53e3cfebb392b1a0ef50fdd02faafec6dc63.tar.gz gdb-bdfe53e3cfebb392b1a0ef50fdd02faafec6dc63.tar.bz2 |
arc: Change max instruction length to 64-bits
The current handling for arc instructions longer than 32-bits is all
handled as a special case in both the assembler and disassembler.
The problem with this approach is that it leads to code duplication,
selecting a long instruction is exactly the same process as selecting a
short instruction, except over more bits, in both cases we select based
on bit comparison, and initial operand insertion and extraction.
This commit unifies both the long and short instruction worlds,
converting the core opcodes library from being largely 32-bit focused,
to being largely 64-bit focused.
The changes are, on the whole, not too much. There's obviously a lot of
type changes but otherwise the bulk of the code just works. Most of the
actual functional changes are to code that previously handled the longer
48 or 64 bit instructions. The insert/extract handlers for these have
now been brought into line with the short instruction insert/extract
handlers.
All of the special case handling code that was previously added has now
been removed again. Overall, this commit reduces the amount of code in
the arc assembler and disassembler.
gas/ChangeLog:
* config/tc-arc.c (struct arc_insn): Change type of insn field.
(md_number_to_chars_midend): Support 6- and 8-byte values.
(emit_insn0): Update debug output.
(find_opcode_match): Likewise.
(build_fake_opcode_hash_entry): Delete.
(find_special_case_long_opcode): Delete.
(find_special_case): Remove long format special case handling.
(insert_operand): Change instruction type and update debug print
format.
(assemble_insn): Change instruction type, update debug print
formats, and remove unneeded assert.
include/ChangeLog:
* opcode/arc.h (struct arc_opcode): Change type of opcode and mask
fields.
(struct arc_long_opcode): Delete.
(struct arc_operand): Change types for insert and extract
handlers.
opcodes/ChangeLog:
* arc-dis.c (struct arc_operand_iterator): Remove all fields
relating to long instruction processing, add new limm field.
(OPCODE): Rename to...
(OPCODE_32BIT_INSN): ...this.
(OPCODE_AC): Delete.
(skip_this_opcode): Handle different instruction lengths, update
macro name.
(special_flag_p): Update parameter type.
(find_format_from_table): Update for more instruction lengths.
(find_format_long_instructions): Delete.
(find_format): Update for more instruction lengths.
(arc_insn_length): Likewise.
(extract_operand_value): Update for more instruction lengths.
(operand_iterator_next): Remove code relating to long
instructions.
(arc_opcode_to_insn_type): New function.
(print_insn_arc):Update for more instructions lengths.
* arc-ext.c (extInstruction_t): Change argument type.
* arc-ext.h (extInstruction_t): Change argument type.
* arc-fxi.h: Change type unsigned to unsigned long long
extensively throughout.
* arc-nps400-tbl.h: Add long instructions taken from
arc_long_opcodes table in arc-opc.c.
* arc-opc.c: Update parameter types on insert/extract handlers.
(arc_long_opcodes): Delete.
(arc_num_long_opcodes): Delete.
(arc_opcode_len): Update for more instruction lengths.
Diffstat (limited to 'opcodes/arc-ext.c')
-rw-r--r-- | opcodes/arc-ext.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/opcodes/arc-ext.c b/opcodes/arc-ext.c index 3cf3e2f..d0c0bcb 100644 --- a/opcodes/arc-ext.c +++ b/opcodes/arc-ext.c @@ -280,7 +280,7 @@ ExtReadWrite_image (enum ExtReadWrite val) /* Get the name of an extension instruction. */ const extInstruction_t * -arcExtMap_insn (int opcode, int insn) +arcExtMap_insn (int opcode, unsigned long long insn) { /* Here the following tasks need to be done. First of all, the opcode stored in the Extension Map is the real opcode. However, |