aboutsummaryrefslogtreecommitdiff
path: root/opcodes/arc-opc.c
diff options
context:
space:
mode:
authorGraham Markall <graham.markall@embecosm.com>2016-10-18 20:10:25 +0100
committerGraham Markall <graham.markall@embecosm.com>2016-11-03 17:14:38 +0000
commit5a736821eff3aa4a8da237778526f9f700759c7a (patch)
treecb82b834d2431eefa39fe4626457741daa61653c /opcodes/arc-opc.c
parentbdfe53e3cfebb392b1a0ef50fdd02faafec6dc63 (diff)
downloadfsf-binutils-gdb-5a736821eff3aa4a8da237778526f9f700759c7a.zip
fsf-binutils-gdb-5a736821eff3aa4a8da237778526f9f700759c7a.tar.gz
fsf-binutils-gdb-5a736821eff3aa4a8da237778526f9f700759c7a.tar.bz2
arc: Implement NPS-400 dcmac instruction
gas/ChangeLog: * testsuite/gas/arc/nps-400-9.d: Added. * testsuite/gas/arc/nps-400-9.s: Added. include/ChangeLog: * opcode/arc.h: Add PROTOCOL_DECODE to insn_class_t. opcodes/ChangeLog: * arc-dis.c (arc_insn_length): Return length 8 for instructions with major opcode 0xa. * arc-nps-400-tbl.h: Add dcmac instruction. * arc-opc.c (arc_operands): Added operands for dcmac instruction. (insert_nps_rbdouble_64): Added. (extract_nps_rbdouble_64): Added. (insert_nps_proto_size): Added. (extract_nps_proto_size): Added.
Diffstat (limited to 'opcodes/arc-opc.c')
-rw-r--r--opcodes/arc-opc.c47
1 files changed, 46 insertions, 1 deletions
diff --git a/opcodes/arc-opc.c b/opcodes/arc-opc.c
index ee14fed..58b26ea 100644
--- a/opcodes/arc-opc.c
+++ b/opcodes/arc-opc.c
@@ -1026,6 +1026,7 @@ MAKE_1BASED_INSERT_EXTRACT_FUNCS (bits_to_scramble, 12, 8, 3)
MAKE_1BASED_INSERT_EXTRACT_FUNCS (bdlen_max_len, 5, 256, 8)
MAKE_1BASED_INSERT_EXTRACT_FUNCS (bd_num_buff, 6, 8, 3)
MAKE_1BASED_INSERT_EXTRACT_FUNCS (pmu_num_job, 6, 4, 2)
+MAKE_1BASED_INSERT_EXTRACT_FUNCS (proto_size, 16, 64, 6)
static unsigned long long
insert_nps_min_hofs (unsigned long long insn ATTRIBUTE_UNUSED,
@@ -1083,6 +1084,30 @@ MAKE_INSERT_NPS_ADDRTYPE (csd, CSD)
MAKE_INSERT_NPS_ADDRTYPE (cxa, CXA)
MAKE_INSERT_NPS_ADDRTYPE (cxd, CXD)
+static unsigned long long
+insert_nps_rbdouble_64 (unsigned long long insn ATTRIBUTE_UNUSED,
+ long long int value ATTRIBUTE_UNUSED,
+ const char **errmsg ATTRIBUTE_UNUSED)
+{
+ if (value < 0 || value > 31)
+ *errmsg = _("Value must be in the range 0 to 31");
+ return insn | (value << 43) | (value << 48);
+}
+
+
+static long long int
+extract_nps_rbdouble_64 (unsigned long long insn ATTRIBUTE_UNUSED,
+ bfd_boolean * invalid ATTRIBUTE_UNUSED)
+{
+ int value1 = (insn >> 43) & 0x1F;
+ int value2 = (insn >> 48) & 0x1F;
+
+ if (value1 != value2)
+ *invalid = TRUE;
+
+ return value1;
+}
+
/* Include the generic extract/insert functions. Order is important
as some of the functions present in the .h may be disabled via
defines. */
@@ -2088,8 +2113,28 @@ const struct arc_operand arc_operands[] =
#define NPS_R_SRC2_3B_64 (NPS_R_SRC1_3B_64 + 1)
{ 3, 53, 0, ARC_OPERAND_IR | ARC_OPERAND_NCHK, insert_nps_3bit_reg_at_53_src2, extract_nps_3bit_reg_at_53_src2 },
-};
+#define NPS_RA_64 (NPS_R_SRC2_3B_64 + 1)
+ { 6, 53, 0, ARC_OPERAND_IR, NULL, NULL },
+
+#define NPS_RB_64 (NPS_RA_64 + 1)
+ { 5, 48, 0, ARC_OPERAND_IR, NULL, NULL },
+
+#define NPS_RBdup_64 (NPS_RB_64 + 1)
+ { 5, 43, 0, ARC_OPERAND_IR | ARC_OPERAND_DUPLICATE, NULL, NULL },
+
+#define NPS_RBdouble_64 (NPS_RBdup_64 + 1)
+ { 10, 43, 0, ARC_OPERAND_IR | ARC_OPERAND_NCHK, insert_nps_rbdouble_64, extract_nps_rbdouble_64 },
+
+#define NPS_RC_64 (NPS_RBdouble_64 + 1)
+ { 5, 43, 0, ARC_OPERAND_IR, NULL, NULL },
+
+#define NPS_UIMM16_0_64 (NPS_RC_64 + 1)
+ { 16, 0, 0, ARC_OPERAND_UNSIGNED, NULL, NULL },
+
+#define NPS_PROTO_SIZE (NPS_UIMM16_0_64 + 1)
+ { 6, 16, 0, ARC_OPERAND_UNSIGNED | ARC_OPERAND_NCHK, insert_nps_proto_size, extract_nps_proto_size }
+};
const unsigned arc_num_operands = ARRAY_SIZE (arc_operands);
const unsigned arc_Toperand = FKT_T;