From: Tsukasa OI <research_trasio@irq.a4lg.com>
To: Tsukasa OI <research_trasio@irq.a4lg.com>,
Nelson Chu <nelson@rivosinc.com>,
Kito Cheng <kito.cheng@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>
Cc: binutils@sourceware.org
Subject: [PATCH 2/2] RISC-V: Implications from 'Zc[fd]' extensions
Date: Mon, 24 Jul 2023 05:38:52 +0000 [thread overview]
Message-ID: <78042a623fd4f5da8aab0cb0cad4a6c04c5529b6.1690177089.git.research_trasio@irq.a4lg.com> (raw)
In-Reply-To: <cover.1690177089.git.research_trasio@irq.a4lg.com>
From: Tsukasa OI <research_trasio@irq.a4lg.com>
The version 1.0.4-1 of the code size reduction specification clarifies
that 'Zcf' implies 'F' and 'Zcd' implies 'D'.
cf:
<https://github.com/riscv/riscv-code-size-reduction/releases/tag/v1.0.4-1>
This commit adds those implications.
bfd/ChangeLog:
* elfxx-riscv.c (riscv_implicit_subsets): Add two implications,
'Zcf' -> 'F' and 'Zcd' -> 'D'.
gas/ChangeLog:
* testsuite/gas/riscv/march-imply-zcd.d: New test.
* testsuite/gas/riscv/march-imply-zcf.d: New test.
---
bfd/elfxx-riscv.c | 2 ++
gas/testsuite/gas/riscv/march-imply-zcd.d | 6 ++++++
gas/testsuite/gas/riscv/march-imply-zcf.d | 6 ++++++
3 files changed, 14 insertions(+)
create mode 100644 gas/testsuite/gas/riscv/march-imply-zcd.d
create mode 100644 gas/testsuite/gas/riscv/march-imply-zcf.d
diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
index eaf496649db1..b43d2cfa0fab 100644
--- a/bfd/elfxx-riscv.c
+++ b/bfd/elfxx-riscv.c
@@ -1132,6 +1132,8 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] =
{"zvl256b", "zvl128b", check_implicit_always},
{"zvl128b", "zvl64b", check_implicit_always},
{"zvl64b", "zvl32b", check_implicit_always},
+ {"zcd", "d", check_implicit_always},
+ {"zcf", "f", check_implicit_always},
{"zfa", "f", check_implicit_always},
{"d", "f", check_implicit_always},
{"zfh", "zfhmin", check_implicit_always},
diff --git a/gas/testsuite/gas/riscv/march-imply-zcd.d b/gas/testsuite/gas/riscv/march-imply-zcd.d
new file mode 100644
index 000000000000..e7c75f649a8b
--- /dev/null
+++ b/gas/testsuite/gas/riscv/march-imply-zcd.d
@@ -0,0 +1,6 @@
+#as: -march=rv32i_zcd -march-attr -misa-spec=20191213
+#readelf: -A
+#source: empty.s
+Attribute Section: riscv
+File Attributes
+ Tag_RISCV_arch: "rv32i2p1_f2p2_d2p2_zicsr2p0_zca1p0_zcd1p0"
diff --git a/gas/testsuite/gas/riscv/march-imply-zcf.d b/gas/testsuite/gas/riscv/march-imply-zcf.d
new file mode 100644
index 000000000000..3829637a16fa
--- /dev/null
+++ b/gas/testsuite/gas/riscv/march-imply-zcf.d
@@ -0,0 +1,6 @@
+#as: -march=rv32i_zcf -march-attr -misa-spec=20191213
+#readelf: -A
+#source: empty.s
+Attribute Section: riscv
+File Attributes
+ Tag_RISCV_arch: "rv32i2p1_f2p2_zicsr2p0_zca1p0_zcf1p0"
--
2.41.0
next prev parent reply other threads:[~2023-07-24 5:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-24 5:38 [PATCH 0/2] RISC-V: Reflect v1.0.4-1 of the code size reduction spec Tsukasa OI
2023-07-24 5:38 ` [PATCH 1/2] RISC-V: Prohibit the 'Zcf' extension on RV64 Tsukasa OI
2023-07-24 5:38 ` Tsukasa OI [this message]
2023-07-24 23:22 ` [PATCH 0/2] RISC-V: Reflect v1.0.4-1 of the code size reduction spec Nelson Chu
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=78042a623fd4f5da8aab0cb0cad4a6c04c5529b6.1690177089.git.research_trasio@irq.a4lg.com \
--to=research_trasio@irq.a4lg.com \
--cc=binutils@sourceware.org \
--cc=kito.cheng@sifive.com \
--cc=nelson@rivosinc.com \
--cc=palmer@dabbelt.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).