public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
From: Nelson Chu <nelsonc1225@sourceware.org>
To: bfd-cvs@sourceware.org
Subject: [binutils-gdb] RISC-V: Add configuration-setting instructions for T-Head VECTOR vendor extension
Date: Thu, 23 Nov 2023 02:08:51 +0000 (GMT)	[thread overview]
Message-ID: <20231123020853.CBD5A385803B@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9aa5dde64d7bad3f405d42ac8c25b91775864178

commit 9aa5dde64d7bad3f405d42ac8c25b91775864178
Author: Jin Ma <jinma@linux.alibaba.com>
Date:   Sat Nov 18 15:04:01 2023 +0800

    RISC-V: Add configuration-setting instructions for T-Head VECTOR vendor extension
    
    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 <lifang_xia@linux.alibaba.com>
    Co-developed-by: Christoph Müllner <christoph.muellner@vrull.eu>
    
    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..

Diff:
---
 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(+)

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 },

                 reply	other threads:[~2023-11-23  2:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20231123020853.CBD5A385803B@sourceware.org \
    --to=nelsonc1225@sourceware.org \
    --cc=bfd-cvs@sourceware.org \
    /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).