From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out30-100.freemail.mail.aliyun.com (out30-100.freemail.mail.aliyun.com [115.124.30.100]) by sourceware.org (Postfix) with ESMTPS id CBB213858D20 for ; Sat, 18 Nov 2023 07:04:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CBB213858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.alibaba.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CBB213858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=115.124.30.100 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700291060; cv=none; b=WHk1pSpWFQbQw2ZfZMlT/Rgox8SCdB4WbbbTpVWwcK3znCzabZTr5HSzKOHm57LBhescJK/QFOA6LuTs4eD3Js+NL7oFPsf6QDELOEIjQkOSC9qd+lxHGHtrI1VJdq8fZLbnbDv2rVOlbQsnoSBLenUTJROiZqL5TpX6b2aveKI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700291060; c=relaxed/simple; bh=x5q9DZGK7LYk36m34flzOo1O0ifNItP3w2anK3tuDKw=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=CYWRBLaaA+503Or6KJLJ8MUo9/NYedjtcL8BujFu1U8EVD1nvFT/jcuvg4WRDYw1m/PdqWnCx1r5eRqbRNTE6vO/BtGXTfvktscYCHmWXMubqgyn94AvwYG4p568Z7nmOFqvNOO8bB/NUMu4SWzbOdEpcNMo7UoqWXrkhWTwh4o= ARC-Authentication-Results: i=1; server2.sourceware.org X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R291e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045192;MF=jinma@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0VwbhOPK_1700291052; Received: from localhost.localdomain(mailfrom:jinma@linux.alibaba.com fp:SMTPD_---0VwbhOPK_1700291052) by smtp.aliyun-inc.com; Sat, 18 Nov 2023 15:04:14 +0800 From: Jin Ma To: binutils@sourceware.org, nelson@rivosinc.com Cc: christoph.muellner@vrull.eu, lifang_xia@linux.alibaba.com, jinma.contrib@gmail.com, Jin Ma Subject: [PATCH v2 03/12] RISC-V: Add configuration-setting instructions for T-Head VECTOR vendor extension Date: Sat, 18 Nov 2023 15:04:01 +0800 Message-Id: <20231118070401.1205-1-jinma@linux.alibaba.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20231118064928.849-1-jinma@linux.alibaba.com> References: <20231118064928.849-1-jinma@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-20.5 required=5.0 tests=BAYES_00,ENV_AND_HDR_SPF_MATCH,GIT_PATCH_0,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: T-Head has a range of vendor-specific instructions. Therefore it makes sense to group them into smaller chunks in form of vendor extensions. This patch adds configuration-setting instructions for the "XTheadVector" extension. The 'th' prefix and the "XTheadVector" extension are documented in a PR for the RISC-V toolchain conventions ([1]). [1] https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/19 Co-developed-by: Lifang Xia Co-developed-by: Christoph Müllner gas/ChangeLog: * testsuite/gas/riscv/x-thead-vector.d: New test. * testsuite/gas/riscv/x-thead-vector.s: New test. opcodes/ChangeLog: * riscv-opc.c: Likewise.. --- gas/testsuite/gas/riscv/x-thead-vector.d | 12 ++++++++++++ gas/testsuite/gas/riscv/x-thead-vector.s | 3 +++ opcodes/riscv-opc.c | 4 ++++ 3 files changed, 19 insertions(+) create mode 100644 gas/testsuite/gas/riscv/x-thead-vector.d diff --git a/gas/testsuite/gas/riscv/x-thead-vector.d b/gas/testsuite/gas/riscv/x-thead-vector.d new file mode 100644 index 00000000000..e509ed0971b --- /dev/null +++ b/gas/testsuite/gas/riscv/x-thead-vector.d @@ -0,0 +1,12 @@ +#as: -march=rv32if_xtheadvector +#objdump: -dr + +.*:[ ]+file format .* + + +Disassembly of section .text: + +0+000 <.text>: +[ ]+[0-9a-f]+:[ ]+80c5f557[ ]+th.vsetvl[ ]+a0,a1,a2 +[ ]+[0-9a-f]+:[ ]+0005f557[ ]+th.vsetvli[ ]+a0,a1,e8,m1,tu,mu +[ ]+[0-9a-f]+:[ ]+7ff5f557[ ]+th.vsetvli[ ]+a0,a1,2047 diff --git a/gas/testsuite/gas/riscv/x-thead-vector.s b/gas/testsuite/gas/riscv/x-thead-vector.s index e69de29bb2d..ffea0a6f9f9 100644 --- a/gas/testsuite/gas/riscv/x-thead-vector.s +++ b/gas/testsuite/gas/riscv/x-thead-vector.s @@ -0,0 +1,3 @@ + th.vsetvl a0, a1, a2 + th.vsetvli a0, a1, 0 + th.vsetvli a0, a1, 0x7ff diff --git a/opcodes/riscv-opc.c b/opcodes/riscv-opc.c index 72d727cd77e..4c2a9b5abef 100644 --- a/opcodes/riscv-opc.c +++ b/opcodes/riscv-opc.c @@ -2234,6 +2234,10 @@ const struct riscv_opcode riscv_opcodes[] = {"th.sync.is", 0, INSN_CLASS_XTHEADSYNC, "", MATCH_TH_SYNC_IS, MASK_TH_SYNC_IS, match_opcode, 0}, {"th.sync.s", 0, INSN_CLASS_XTHEADSYNC, "", MATCH_TH_SYNC_S, MASK_TH_SYNC_S, match_opcode, 0}, +/* Vendor-specific (T-Head) XTheadVector instructions. */ +{"th.vsetvl", 0, INSN_CLASS_XTHEADVECTOR, "d,s,t", MATCH_VSETVL, MASK_VSETVL, match_opcode, 0}, +{"th.vsetvli", 0, INSN_CLASS_XTHEADVECTOR, "d,s,Vc", MATCH_VSETVLI, MASK_VSETVLI, match_opcode, 0}, + /* Vendor-specific (Ventana Microsystems) XVentanaCondOps instructions */ {"vt.maskc", 64, INSN_CLASS_XVENTANACONDOPS, "d,s,t", MATCH_VT_MASKC, MASK_VT_MASKC, match_opcode, 0 }, {"vt.maskcn", 64, INSN_CLASS_XVENTANACONDOPS, "d,s,t", MATCH_VT_MASKCN, MASK_VT_MASKCN, match_opcode, 0 }, -- 2.17.1