From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 84027 invoked by alias); 2 Apr 2016 22:51:46 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 83794 invoked by uid 89); 2 Apr 2016 22:51:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=Pipeline, 0c, ie1, wft X-HELO: mail-lf0-f43.google.com Received: from mail-lf0-f43.google.com (HELO mail-lf0-f43.google.com) (209.85.215.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sat, 02 Apr 2016 22:51:31 +0000 Received: by mail-lf0-f43.google.com with SMTP id g184so44770362lfb.3 for ; Sat, 02 Apr 2016 15:51:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3G9T8LMiwHxz3tqeIiy81RodLzZUJPF+zaLnSv9F6Bg=; b=MHOU9XM3shmK3ITYcoz0JUcJynGNzJMCU6QGGSewETeK1c+1hd+11C4C97me811vTg y6KnBiiN3DpUch0xyFF1TVXsQ1CZQ5+zlh3SLsfG/EAEo85ZDzkiNI+EYk6vm5JS5mLl VGvQ46f0/LVdqVVsGHDHt0FJiC7YK7Dn/DSPBep+62fgbj1Wrne7f4NrHgDyAd4SKpJG OZrBITelyf/XOoeahKKABEMAQ9xFPgCiCaMMx8ci83KQ68WrN7Jf6l2ugix6FTT30xKU bri3Cnp+/LPgEzm5BXaGdAz/Imd1+asBkUTPswKO+8bMJQFV16UDMe99cGaII4l4z38/ ihyQ== X-Gm-Message-State: AD7BkJIp/2aR1vOGgJ43ItWbjX6oHoYtvfl9WYt9zfRFH14qACZkzuHfwJ+ZaF8SQpXuvQ== X-Received: by 10.194.236.198 with SMTP id uw6mr15701175wjc.42.1459637487656; Sat, 02 Apr 2016 15:51:27 -0700 (PDT) Received: from localhost (host81-140-212-51.range81-140.btcentralplus.com. [81.140.212.51]) by smtp.gmail.com with ESMTPSA id qb8sm7331303wjc.24.2016.04.02.15.51.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Apr 2016 15:51:27 -0700 (PDT) From: Andrew Burgess To: binutils@sourceware.org Cc: Claudiu.Zissulescu@synopsys.com, noamca@mellanox.com, Andrew Burgess Subject: [PATCH 6/6] arc/nps400: Add new control instructions Date: Sat, 02 Apr 2016 22:51:00 -0000 Message-Id: <1459637470-30538-6-git-send-email-andrew.burgess@embecosm.com> In-Reply-To: <1459637470-30538-1-git-send-email-andrew.burgess@embecosm.com> References: <1459637470-30538-1-git-send-email-andrew.burgess@embecosm.com> X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00026.txt.bz2 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 93a7d77..7bd281c 100644 --- a/gas/config/tc-arc.h +++ b/gas/config/tc-arc.h @@ -210,7 +210,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 493c5b6..a4658e5 100644 --- a/opcodes/arc-nps400-tbl.h +++ b/opcodes/arc-nps400-tbl.h @@ -11,3 +11,20 @@ /* movb<.f><.cl> */ { "movb", 0x48010000, 0xf80f8000, ARC_OPCODE_NPS400, BITOP, NONE, { NPS_R_DST_3B, NPS_R_SRC1_3B, NPS_R_SRC2_3B, NPS_BITOP_DST_POS, NPS_BITOP_SRC_POS, NPS_BITOP_SIZE }, { C_NPS_F }}, { "movb", 0x48018000, 0xf80f8000, ARC_OPCODE_NPS400, BITOP, NONE, { NPS_R_DST_3B, NPS_R_SRC2_3B, NPS_BITOP_DST_POS, NPS_BITOP_SRC_POS, NPS_BITOP_SIZE }, { C_NPS_F, C_NPS_CL }}, + +/**** 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 231ef4b..da530fe 100644 --- a/opcodes/arc-opc.c +++ b/opcodes/arc-opc.c @@ -903,6 +903,37 @@ const struct arc_flag_operand arc_flag_operands[] = #define F_NPS_FLAG (F_NPS_CL + 1) { "f", 1, 1, 20, 1 }, + +#define F_NPS_RW (F_NPS_FLAG + 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); @@ -981,6 +1012,25 @@ const struct arc_flag_class arc_flag_classes[] = #define C_NPS_F (C_NPS_CL + 1) { F_CLASS_OPTIONAL, { F_NPS_FLAG, F_NULL}}, + +#define C_NPS_SCHD_RW (C_NPS_F + 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