From 06fe285fd293e999481ec8f5c619658aa5e3b48b Mon Sep 17 00:00:00 2001 From: Graham Markall Date: Thu, 29 Sep 2016 19:25:25 +0100 Subject: 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. --- gas/ChangeLog | 5 +++++ gas/config/tc-arc.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'gas') diff --git a/gas/ChangeLog b/gas/ChangeLog index d7aa0c1..63a885b 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,10 @@ 2016-11-03 Graham Markall + * config/tc-arc.c (assemble_insn): Replace use of ARC_SHORT with + arc_opcode_len. + +2016-11-03 Graham Markall + * config/tc-arc.c (struct arc_insn): Replace short_insn flag with len field. (apply_fixups): Update to use len field. diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c index 5ced8f0..69dad38 100644 --- a/gas/config/tc-arc.c +++ b/gas/config/tc-arc.c @@ -3879,7 +3879,8 @@ assemble_insn (const struct arc_opcode *opcode, break; case O_pcl: reloc = ARC_RELOC_TABLE (t->X_md)->reloc; - if (ARC_SHORT (opcode->mask) || opcode->insn_class == JUMP) + if (arc_opcode_len (opcode) == 2 + || opcode->insn_class == JUMP) as_bad_where (frag_now->fr_file, frag_now->fr_line, _("Unable to use @pcl relocation for insn %s"), opcode->name); @@ -4011,7 +4012,8 @@ assemble_insn (const struct arc_opcode *opcode, insn->relax = relax_insn_p (opcode, tok, ntok, pflags, nflg); /* Instruction length. */ - insn->len = ARC_SHORT (opcode->mask) ? 2 : 4; + insn->len = arc_opcode_len (opcode); + gas_assert (insn->len == 2 || insn->len == 4); insn->insn = image; -- cgit v1.1