RISC-V: Implications from 'Zc[fd]' extensions
authorTsukasa OI <research_trasio@irq.a4lg.com>
Mon, 24 Jul 2023 05:09:39 +0000 (05:09 +0000)
committerTsukasa OI <research_trasio@irq.a4lg.com>
Mon, 24 Jul 2023 23:42:35 +0000 (23:42 +0000)
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
gas/testsuite/gas/riscv/march-imply-zcd.d [new file with mode: 0644]
gas/testsuite/gas/riscv/march-imply-zcf.d [new file with mode: 0644]

index eaf496649db167fcf1c0887119afcab2186a2f31..b43d2cfa0fab6876f46b33e6f75c99ad9130620a 100644 (file)
@@ -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 (file)
index 0000000..e7c75f6
--- /dev/null
@@ -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 (file)
index 0000000..3829637
--- /dev/null
@@ -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"