public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Christoph Muellner <christoph.muellner@vrull.eu>
To: binutils@sourceware.org, Nelson Chu <nelson@rivosinc.com>,
	Kito Cheng <kito.cheng@sifive.com>,
	Jim Wilson <jim.wilson.gcc@gmail.com>,
	Philipp Tomsich <philipp.tomsich@vrull.eu>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Cooper Qu <cooper.qu@linux.alibaba.com>,
	Lifang Xia <lifang_xia@linux.alibaba.com>,
	Yunhai Shang <yunhai@linux.alibaba.com>,
	Zhiwei Liu <zhiwei_liu@linux.alibaba.com>
Cc: "Christoph Müllner" <christoph.muellner@vrull.eu>
Subject: [PATCH 13/13] riscv: Add T-Head entries for the -mcpu= flag
Date: Tue,  6 Sep 2022 14:22:13 +0200	[thread overview]
Message-ID: <20220906122213.1243129-14-christoph.muellner@vrull.eu> (raw)
In-Reply-To: <20220906122213.1243129-1-christoph.muellner@vrull.eu>

From: Christoph Müllner <christoph.muellner@vrull.eu>

This patch adds the following T-Head CPUs to the list of known CPUs:
* C906
* C910

Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
---
 gas/config/tc-riscv.c                  | 6 ++++++
 gas/doc/c-riscv.texi                   | 3 ++-
 gas/testsuite/gas/riscv/mcpu-ok-c906.d | 6 ++++++
 gas/testsuite/gas/riscv/mcpu-ok-c910.d | 6 ++++++
 4 files changed, 20 insertions(+), 1 deletion(-)
 create mode 100644 gas/testsuite/gas/riscv/mcpu-ok-c906.d
 create mode 100644 gas/testsuite/gas/riscv/mcpu-ok-c910.d

diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c
index 22109e5912f..1d606b60ce9 100644
--- a/gas/config/tc-riscv.c
+++ b/gas/config/tc-riscv.c
@@ -3525,6 +3525,12 @@ struct riscv_cpu_option_table
 /* This table maps a CPU name (for -mcpu=$name) to the corresponding
    arch string.  */
 static const struct riscv_cpu_option_table riscv_cpus[] = {
+  { "thead-c906", "rv64gc_xtheadba_xtheadbb_xtheadbs_xtheadcmo_xtheadcondmov"
+		  "_xtheadfmemidx_xtheadmac_xtheadmemidx_xtheadmempair"
+		  "_xtheadsync" },
+  { "thead-c910", "rv64gc_xtheadba_xtheadbb_xtheadbs_xtheadcmo_xtheadcondmov"
+		  "_xtheadfmemidx_xtheadmac_xtheadmemidx_xtheadmempair"
+		  "_xtheadsync" },
   { NULL, NULL }
 };
 
diff --git a/gas/doc/c-riscv.texi b/gas/doc/c-riscv.texi
index 488f88791d1..68705ed89c9 100644
--- a/gas/doc/c-riscv.texi
+++ b/gas/doc/c-riscv.texi
@@ -50,7 +50,8 @@ will check the default configure setting --with-arch=ISA.
 @item -mcpu=CPU
 This option specifies the target processor.  The assembler will issue an error
 message if an attempt is made to assemble an instruction which will not execute
-on the target processor.
+on the target processor.  The following processor names are recognized:
+@code{thead-c906}, and @code{thead-c910}.
 
 @cindex @samp{-misa-spec=ISAspec} option, RISC-V
 @item -misa-spec=ISAspec
diff --git a/gas/testsuite/gas/riscv/mcpu-ok-c906.d b/gas/testsuite/gas/riscv/mcpu-ok-c906.d
new file mode 100644
index 00000000000..ce06f3e323b
--- /dev/null
+++ b/gas/testsuite/gas/riscv/mcpu-ok-c906.d
@@ -0,0 +1,6 @@
+#as: -mcpu=thead-c906
+#readelf: -A
+#source: empty.s
+Attribute Section: riscv
+File Attributes
+  Tag_RISCV_arch: "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0_xtheadba1p0_xtheadbb1p0_xtheadbs1p0_xtheadcmo1p0_xtheadcondmov1p0_xtheadfmemidx1p0_xtheadmac1p0_xtheadmemidx1p0_xtheadmempair1p0_xtheadsync1p0"
diff --git a/gas/testsuite/gas/riscv/mcpu-ok-c910.d b/gas/testsuite/gas/riscv/mcpu-ok-c910.d
new file mode 100644
index 00000000000..0e660c10a81
--- /dev/null
+++ b/gas/testsuite/gas/riscv/mcpu-ok-c910.d
@@ -0,0 +1,6 @@
+#as: -mcpu=thead-c910
+#readelf: -A
+#source: empty.s
+Attribute Section: riscv
+File Attributes
+  Tag_RISCV_arch: "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0_xtheadba1p0_xtheadbb1p0_xtheadbs1p0_xtheadcmo1p0_xtheadcondmov1p0_xtheadfmemidx1p0_xtheadmac1p0_xtheadmemidx1p0_xtheadmempair1p0_xtheadsync1p0"
-- 
2.37.2


  parent reply	other threads:[~2022-09-06 12:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-06 12:22 [PATCH 00/13] Add support for the T-Head vendor extensions Christoph Muellner
2022-09-06 12:22 ` [PATCH 01/13] RISC-V: Add generic support for " Christoph Muellner
2022-09-06 12:22 ` [PATCH 02/13] RISC-V: Add T-Head CMO vendor extension Christoph Muellner
2022-09-06 12:22 ` [PATCH 03/13] RISC-V: Add T-Head SYNC " Christoph Muellner
2022-09-06 12:22 ` [PATCH 04/13] RISC-V: Add support for arbitrary immediate encoding formats Christoph Muellner
2022-09-06 12:22 ` [PATCH 05/13] RISC-V: Add T-Head Bitmanip vendor extension Christoph Muellner
2022-09-06 12:22 ` [PATCH 06/13] RISC-V: Add T-Head CondMov " Christoph Muellner
2022-09-06 12:22 ` [PATCH 07/13] RISC-V: Add T-Head MAC " Christoph Muellner
2022-09-06 12:22 ` [PATCH 08/13] RISC-V: Add T-Head FMemIdx " Christoph Muellner
2022-09-06 12:22 ` [PATCH 09/13] RISC-V: Add T-Head MemIdx " Christoph Muellner
2022-09-06 12:22 ` [PATCH 10/13] RISC-V: Add support for literal instruction arguments Christoph Muellner
2022-09-06 12:22 ` [PATCH 11/13] RISC-V: Add T-Head MemPair vendor extension Christoph Muellner
2022-09-06 12:22 ` [PATCH 12/13] riscv: gas: Add command line option '-mcpu=' to specify the CPU Christoph Muellner
2022-09-06 12:22 ` Christoph Muellner [this message]
2022-09-16  9:36 ` [PATCH 00/13] Add support for the T-Head vendor extensions Nelson Chu
2022-09-16  9:58   ` Palmer Dabbelt
2022-09-18  6:51     ` Christoph Müllner
2022-09-18  6:50   ` Christoph Müllner
2022-09-22 11:08     ` Philipp Tomsich

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=20220906122213.1243129-14-christoph.muellner@vrull.eu \
    --to=christoph.muellner@vrull.eu \
    --cc=binutils@sourceware.org \
    --cc=cooper.qu@linux.alibaba.com \
    --cc=jim.wilson.gcc@gmail.com \
    --cc=kito.cheng@sifive.com \
    --cc=lifang_xia@linux.alibaba.com \
    --cc=nelson@rivosinc.com \
    --cc=palmer@dabbelt.com \
    --cc=philipp.tomsich@vrull.eu \
    --cc=yunhai@linux.alibaba.com \
    --cc=zhiwei_liu@linux.alibaba.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).