aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog7
-rw-r--r--opcodes/arc-dis.c8
-rw-r--r--opcodes/arc-opc.c10
3 files changed, 21 insertions, 4 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 31809b4..634ad27 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,10 @@
+2016-11-03 Graham Markall <graham.markall@embecosm.com>
+
+ * 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.
+
2016-11-03 Andrew Burgess <andrew.burgess@embecosm.com>
* arc-nps400-tbl.h: Fix some instruction masks.
diff --git a/opcodes/arc-dis.c b/opcodes/arc-dis.c
index 898512c..a1aaf34 100644
--- a/opcodes/arc-dis.c
+++ b/opcodes/arc-dis.c
@@ -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;
diff --git a/opcodes/arc-opc.c b/opcodes/arc-opc.c
index 6537310..9eb58d3 100644
--- a/opcodes/arc-opc.c
+++ b/opcodes/arc-opc.c
@@ -2648,3 +2648,13 @@ const struct arc_long_opcode arc_long_opcodes[] =
};
const unsigned arc_num_long_opcodes = ARRAY_SIZE (arc_long_opcodes);
+
+/* Return length of instruction represented by OPCODE in bytes. */
+
+int
+arc_opcode_len (const struct arc_opcode *opcode)
+{
+ if (opcode->mask < 0x10000ull)
+ return 2;
+ return 4;
+}