public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: binutils@sourceware.org
Cc: Claudiu.Zissulescu@synopsys.com,	Cupertino.Miranda@synopsys.com,
	noamca@mellanox.com,	Andrew Burgess <andrew.burgess@embecosm.com>
Subject: [PATCHv2 4/4] arc/nps400: Add new instructions
Date: Thu, 07 Apr 2016 12:57:00 -0000	[thread overview]
Message-ID: <1460033811-17805-5-git-send-email-andrew.burgess@embecosm.com> (raw)
In-Reply-To: <1460033811-17805-1-git-send-email-andrew.burgess@embecosm.com>
In-Reply-To: <1459637470-30538-1-git-send-email-andrew.burgess@embecosm.com>

Add some new control instructions to the opcodes library, and a new test
for these new instructions to the assembler.  The new instructions use
an instruction flag longer than any seen before (on arc), and so the max
flag length is extended to accommodate this.

gas/ChangeLog:

	* config/tc-arc.h (MAX_FLAG_NAME_LENGTH): Increase to 7.
	* testsuite/gas/arc/nps400-2.d: New file.
	* testsuite/gas/arc/nps400-2.s: New file.

opcodes/ChangeLog:

	* arc-nps400-tbl.h: Add schd, sync, and hwschd instructions.
	* arc-opc.c (arc_flag_operands): Add new flags.
	(arc_flag_classes): Add new classes.
---
 gas/ChangeLog                    |  6 +++++
 gas/config/tc-arc.h              |  2 +-
 gas/testsuite/gas/arc/nps400-2.d | 18 +++++++++++++++
 gas/testsuite/gas/arc/nps400-2.s | 16 +++++++++++++
 opcodes/ChangeLog                |  6 +++++
 opcodes/arc-nps400-tbl.h         | 17 ++++++++++++++
 opcodes/arc-opc.c                | 50 ++++++++++++++++++++++++++++++++++++++++
 7 files changed, 114 insertions(+), 1 deletion(-)
 create mode 100644 gas/testsuite/gas/arc/nps400-2.d
 create mode 100644 gas/testsuite/gas/arc/nps400-2.s

diff --git a/gas/config/tc-arc.h b/gas/config/tc-arc.h
index 7c193fe..076afea 100644
--- a/gas/config/tc-arc.h
+++ b/gas/config/tc-arc.h
@@ -211,7 +211,7 @@ extern int tc_arc_regname_to_dw2regnum (char *regname);
 #define NOP_OPCODE_S   0x000078E0
 #define NOP_OPCODE_L   0x264A7000 /* mov 0,0.  */
 
-#define MAX_FLAG_NAME_LENGTH 3
+#define MAX_FLAG_NAME_LENGTH 7
 
 struct arc_flags
 {
diff --git a/gas/testsuite/gas/arc/nps400-2.d b/gas/testsuite/gas/arc/nps400-2.d
new file mode 100644
index 0000000..966907e
--- /dev/null
+++ b/gas/testsuite/gas/arc/nps400-2.d
@@ -0,0 +1,18 @@
+#as: -mcpu=nps400
+#objdump: -dr
+
+.*: +file format .*arc.*
+
+Disassembly of section .text:
+
+[0-9a-f]+ <.*>:
+   0:	3e6f 7004           	schd\.rw
+   4:	3e6f 7084           	schd\.rd
+   8:	3e6f 7044           	schd\.wft
+   c:	3e6f 7144           	schd\.wft\.ie1
+  10:	3e6f 7244           	schd\.wft\.ie2
+  14:	3e6f 7344           	schd\.wft\.ie12
+  18:	3e6f 703f           	sync\.rd
+  1c:	3e6f 707f           	sync\.wr
+  20:	3a6f 10bf           	hwschd\.off	r10
+  24:	3e6f 7503           	hwschd\.restore	0,r20
diff --git a/gas/testsuite/gas/arc/nps400-2.s b/gas/testsuite/gas/arc/nps400-2.s
new file mode 100644
index 0000000..de4c839
--- /dev/null
+++ b/gas/testsuite/gas/arc/nps400-2.s
@@ -0,0 +1,16 @@
+        .text
+        ;; schd
+        schd.rw
+        schd.rd
+        schd.wft
+        schd.wft.ie1
+        schd.wft.ie2
+        schd.wft.ie12
+
+        ;; sync
+        sync.rd
+        sync.wr
+
+        ;; hwschd
+        hwschd.off      r10
+        hwschd.restore  0, r20
diff --git a/opcodes/arc-nps400-tbl.h b/opcodes/arc-nps400-tbl.h
index dc7b066..58d479f 100644
--- a/opcodes/arc-nps400-tbl.h
+++ b/opcodes/arc-nps400-tbl.h
@@ -123,3 +123,20 @@
 
 /* crc32<.r> 0,limm,u6		00111 110 01 110100 R 111 uuuuuu 111110 */
 { "crc32", 0x3e74703e, 0xffff703f, ARC_OPCODE_NPS400, BITOP, NONE, { ZA, LIMM, UIMM6_20 }, { C_NPS_R }},
+
+/****                  Pipeline Control Instructions                  ****/
+
+/* schd<.rw|.rd> */
+{ "schd", 0x3e6f7004, 0xffffff7f, ARC_OPCODE_NPS400, CONTROL, NONE, { 0 }, { C_NPS_SCHD_RW }},
+
+/* schd.wft.<.ie1|.ie2|.ie12> */
+{ "schd", 0x3e6f7044, 0xfffffcff, ARC_OPCODE_NPS400, CONTROL, NONE, { 0 }, { C_NPS_SCHD_TRIG, C_NPS_SCHD_IE }},
+
+/* sync<.rd|.wr> */
+{ "sync", 0x3e6f703f, 0xffffffbf, ARC_OPCODE_NPS400, CONTROL, NONE, { 0 }, { C_NPS_SYNC }},
+
+/* hwscd.off B */
+{ "hwschd", 0x386f00bf, 0xf8ff8fff, ARC_OPCODE_NPS400, CONTROL, NONE, { RB }, { C_NPS_HWS_OFF }},
+
+/* hwscd.restore 0,C */
+{ "hwschd", 0x3e6f7003, 0xfffff03f, ARC_OPCODE_NPS400, CONTROL, NONE, { ZA, RC }, { C_NPS_HWS_RESTORE }},
diff --git a/opcodes/arc-opc.c b/opcodes/arc-opc.c
index 69c65fc..d667a78 100644
--- a/opcodes/arc-opc.c
+++ b/opcodes/arc-opc.c
@@ -1003,6 +1003,37 @@ const struct arc_flag_operand arc_flag_operands[] =
 
 #define F_NPS_R     (F_NPS_FLAG + 1)
   { "r",  1, 1, 15, 1 },
+
+#define F_NPS_RW     (F_NPS_R + 1)
+  { "rw", 0, 1, 7, 1 },
+
+#define F_NPS_RD     (F_NPS_RW + 1)
+  { "rd", 1, 1, 7, 1 },
+
+#define F_NPS_WFT     (F_NPS_RD + 1)
+  { "wft", 0, 0, 0, 1 },
+
+#define F_NPS_IE1     (F_NPS_WFT + 1)
+  { "ie1", 1, 2, 8, 1 },
+
+#define F_NPS_IE2     (F_NPS_IE1 + 1)
+  { "ie2", 2, 2, 8, 1 },
+
+#define F_NPS_IE12     (F_NPS_IE2 + 1)
+  { "ie12", 3, 2, 8, 1 },
+
+#define F_NPS_SYNC_RD     (F_NPS_IE12 + 1)
+  { "rd", 0, 1, 6, 1 },
+
+#define F_NPS_SYNC_WR     (F_NPS_SYNC_RD + 1)
+  { "wr", 1, 1, 6, 1 },
+
+#define F_NPS_HWS_OFF     (F_NPS_SYNC_WR + 1)
+  { "off", 0, 0, 0, 1 },
+
+#define F_NPS_HWS_RESTORE     (F_NPS_HWS_OFF + 1)
+  { "restore", 0, 0, 0, 1 },
+
 };
 
 const unsigned arc_num_flag_operands = ARRAY_SIZE (arc_flag_operands);
@@ -1084,6 +1115,25 @@ const struct arc_flag_class arc_flag_classes[] =
 
 #define C_NPS_R     (C_NPS_F + 1)
   { F_CLASS_OPTIONAL, { F_NPS_R, F_NULL}},
+
+#define C_NPS_SCHD_RW     (C_NPS_R + 1)
+  { F_CLASS_REQUIRED, { F_NPS_RW, F_NPS_RD, F_NULL}},
+
+#define C_NPS_SCHD_TRIG     (C_NPS_SCHD_RW + 1)
+  { F_CLASS_REQUIRED, { F_NPS_WFT, F_NULL}},
+
+#define C_NPS_SCHD_IE     (C_NPS_SCHD_TRIG + 1)
+  { F_CLASS_OPTIONAL, { F_NPS_IE1, F_NPS_IE2, F_NPS_IE12, F_NULL}},
+
+#define C_NPS_SYNC     (C_NPS_SCHD_IE + 1)
+  { F_CLASS_REQUIRED, { F_NPS_SYNC_RD, F_NPS_SYNC_WR, F_NULL}},
+
+#define C_NPS_HWS_OFF     (C_NPS_SYNC + 1)
+  { F_CLASS_REQUIRED, { F_NPS_HWS_OFF, F_NULL}},
+
+#define C_NPS_HWS_RESTORE     (C_NPS_HWS_OFF + 1)
+  { F_CLASS_REQUIRED, { F_NPS_HWS_RESTORE, F_NULL}},
+
 };
 
 /* The operands table.
-- 
2.5.1

  parent reply	other threads:[~2016-04-07 12:57 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-02 22:51 [PATCH 1/6] gas/arc: Modify structure used to hold opcodes Andrew Burgess
2016-04-02 22:51 ` [PATCH 6/6] arc/nps400: Add new control instructions Andrew Burgess
2016-04-04  7:52   ` Claudiu Zissulescu
2016-04-05 14:26   ` Nick Clifton
2016-04-02 22:51 ` [PATCH 3/6] gas/arc: Additional work to support multiple arc_opcode chains Andrew Burgess
2016-04-02 22:51 ` [PATCH 2/6] gas/arc: Remove preprocess_operands function Andrew Burgess
2016-04-05 14:23   ` Nick Clifton
2016-04-02 22:51 ` [PATCH 4/6] gas/arc: Handle multiple arc_opcode chains for same mnemonic Andrew Burgess
2016-04-02 22:51 ` [PATCH 5/6] gas/arc: Allow greater range of characters into flag names Andrew Burgess
2016-04-04  7:52   ` Claudiu Zissulescu
2016-04-05 14:25   ` Nick Clifton
2016-04-04  8:22 ` [PATCH 1/6] gas/arc: Modify structure used to hold opcodes Claudiu Zissulescu
2016-04-04  9:10   ` Andrew Burgess
2016-04-04 14:45     ` Claudiu Zissulescu
2016-04-07 12:51       ` Andrew Burgess
2016-04-07 13:08         ` Claudiu Zissulescu
2016-04-07 15:34           ` Nick Clifton
2016-04-07 12:57 ` [PATCHv2 2/4] gas/arc: Additional work to support multiple arc_opcode chains Andrew Burgess
2016-04-07 13:14   ` Claudiu Zissulescu
2016-04-07 15:36   ` Nick Clifton
2016-04-07 12:57 ` [PATCHv2 0/4] arc/nps: Add pipeline control instructions Andrew Burgess
2016-04-07 12:57 ` [PATCHv2 3/4] gas/arc: Handle multiple arc_opcode chains for same mnemonic Andrew Burgess
2016-04-07 13:16   ` Claudiu Zissulescu
2016-04-07 15:37   ` Nick Clifton
2016-04-07 12:57 ` Andrew Burgess [this message]
2016-04-07 13:18   ` [PATCHv2 4/4] arc/nps400: Add new instructions Claudiu Zissulescu
2016-04-07 15:38   ` Nick Clifton
2016-04-07 12:57 ` [PATCHv2 1/4] gas/arc: Modify structure used to hold opcodes Andrew Burgess
2016-04-07 13:10   ` Claudiu Zissulescu
2016-04-07 15:35   ` Nick Clifton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1460033811-17805-5-git-send-email-andrew.burgess@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=Claudiu.Zissulescu@synopsys.com \
    --cc=Cupertino.Miranda@synopsys.com \
    --cc=binutils@sourceware.org \
    --cc=noamca@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).