arc: Replace ARC_SHORT macro with arc_opcode_len function

In preparation for moving to a world where arc instructions can be 2, 4,
6, or 8 bytes in length, replace the ARC_SHORT macro (which is either
true of false) with an arc_opcode_len function that returns a length in
bytes.

There should be no functional change after this commit.

gas/ChangeLog:

	* config/tc-arc.c (assemble_insn): Replace use of ARC_SHORT with
	arc_opcode_len.

include/ChangeLog:

	* opcode/arc.h (arc_opcode_len): Declare.
	(ARC_SHORT): Delete.

opcodes/ChangeLog:

	* arc-dis.c (find_format_from_table): Replace use of ARC_SHORT
	with arc_opcode_len.
	(find_format_long_instructions): Likewise.
	* arc-opc.c (arc_opcode_len): New function.
This commit is contained in:
Graham Markall
2016-09-29 19:25:25 +01:00
parent 91fdca6f26
commit 06fe285fd2
7 changed files with 38 additions and 10 deletions

View File

@@ -272,12 +272,12 @@ find_format_from_table (struct disassemble_info *info,
opcode = &arc_table[i++];
if (ARC_SHORT (opcode->mask) && (insn_len == 2))
if ((arc_opcode_len (opcode) == 2) && (insn_len == 2))
{
if (OPCODE_AC (opcode->opcode) != OPCODE_AC (insn[0]))
continue;
}
else if (!ARC_SHORT (opcode->mask) && (insn_len == 4))
else if ((arc_opcode_len (opcode) == 4) && (insn_len == 4))
{
if (OPCODE (opcode->opcode) != OPCODE (insn[0]))
continue;
@@ -400,12 +400,12 @@ find_format_long_instructions (unsigned *insn,
opcode = &arc_long_opcodes[i].base_opcode;
if (ARC_SHORT (opcode->mask) && (*insn_len == 2))
if ((arc_opcode_len (opcode) == 2) && (*insn_len == 2))
{
if (OPCODE_AC (opcode->opcode) != OPCODE_AC (insn[0]))
continue;
}
else if (!ARC_SHORT (opcode->mask) && (*insn_len == 4))
else if ((arc_opcode_len (opcode) == 4) && (*insn_len == 4))
{
if (OPCODE (opcode->opcode) != OPCODE (insn[0]))
continue;