public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/2] RISC-V: Use only real extension names on testsuite
@ 2022-09-23  7:49 Tsukasa OI
  2022-09-23  7:49 ` [PATCH 1/2] RISC-V: Reorganize "K"-related subextension tests Tsukasa OI
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tsukasa OI @ 2022-09-23  7:49 UTC (permalink / raw)
  To: Tsukasa OI, Nelson Chu, Kito Cheng, Palmer Dabbelt; +Cc: binutils

Hi,

Most of the RISC-V GAS testsuite uses real extension names but there are a
few counterexamples.  I will talk about following tests:

-   b-ext{,-64} for ("Zb*" except "Zbk*")
-   k-ext{,-64} for ("Zk*" and "Zbk*")

They:
-   provide unnecessary confusion (that major "B" and "K" extensions exist),
    for example shown in:
    <https://sourceware.org/bugzilla/show_bug.cgi?id=29341> and
-   do not test separate extension
    (they are multiple subextensions).

To avoid confusion and test individual extensions separately, this patchset
provides per-extension testcases and removes b-ext{,-64} and k-ext{,-64}.

There's another effect.  Splitting "B" testcases will clarify that "zext.h"
and "zext.w" (seemingly similar) instructions belong to different extension:

-   "zext.h" (RV32/64_Zbb)
-   "zext.w" (RV64_Zba)  <-- not Zbb!

[Changes]

-   Split b-ext and b-ext-64 to:
    -   zba{,-64}
    -   zbb{,-64}
    -   zbc
    -   zbs{,-64}
-   Reuse existing "zk*" and "zbk*" testcases because they are fine as is,
-   Add new testcases for separate extension:
    -   zkr (along with 'Zicsr', to test "seed" CSR accessibility)
    -   zkt (just to test extension support)
-   Remove:
    -   b-ext{,-64}
    -   k-ext{,-64}

For vector-insn*, I'll leave this for now but it might possible to split
(e.g. to three testcases for two instruction classes and INSN_V_EEW64).
Still, I think this is not as important as b-ext{,-64} and k-ext{,-64} and
I don't complain about using vector-insn* names themselves.

Thanks,
Tsukasa




Tsukasa OI (2):
  RISC-V: Reorganize "K"-related subextension tests
  RISC-V: Reorganize "B"-related subextension tests

 gas/testsuite/gas/riscv/b-ext-64.d | 72 ------------------------------
 gas/testsuite/gas/riscv/b-ext-64.s | 64 --------------------------
 gas/testsuite/gas/riscv/b-ext.d    | 51 ---------------------
 gas/testsuite/gas/riscv/b-ext.s    | 43 ------------------
 gas/testsuite/gas/riscv/k-ext-64.d | 47 -------------------
 gas/testsuite/gas/riscv/k-ext-64.s | 38 ----------------
 gas/testsuite/gas/riscv/k-ext.d    | 44 ------------------
 gas/testsuite/gas/riscv/k-ext.s    | 35 ---------------
 gas/testsuite/gas/riscv/zba-64.d   | 19 ++++++++
 gas/testsuite/gas/riscv/zba.d      | 12 +++++
 gas/testsuite/gas/riscv/zba.s      | 14 ++++++
 gas/testsuite/gas/riscv/zbb-64.d   | 36 +++++++++++++++
 gas/testsuite/gas/riscv/zbb.d      | 28 ++++++++++++
 gas/testsuite/gas/riscv/zbb.s      | 34 ++++++++++++++
 gas/testsuite/gas/riscv/zbc.d      | 12 +++++
 gas/testsuite/gas/riscv/zbc.s      |  4 ++
 gas/testsuite/gas/riscv/zbs-64.d   | 34 ++++++++++++++
 gas/testsuite/gas/riscv/zbs.d      | 25 +++++++++++
 gas/testsuite/gas/riscv/zbs.s      | 32 +++++++++++++
 gas/testsuite/gas/riscv/zkr.d      | 10 +++++
 gas/testsuite/gas/riscv/zkr.s      |  2 +
 gas/testsuite/gas/riscv/zkt.d      |  5 +++
 22 files changed, 267 insertions(+), 394 deletions(-)
 delete mode 100644 gas/testsuite/gas/riscv/b-ext-64.d
 delete mode 100644 gas/testsuite/gas/riscv/b-ext-64.s
 delete mode 100644 gas/testsuite/gas/riscv/b-ext.d
 delete mode 100644 gas/testsuite/gas/riscv/b-ext.s
 delete mode 100644 gas/testsuite/gas/riscv/k-ext-64.d
 delete mode 100644 gas/testsuite/gas/riscv/k-ext-64.s
 delete mode 100644 gas/testsuite/gas/riscv/k-ext.d
 delete mode 100644 gas/testsuite/gas/riscv/k-ext.s
 create mode 100644 gas/testsuite/gas/riscv/zba-64.d
 create mode 100644 gas/testsuite/gas/riscv/zba.d
 create mode 100644 gas/testsuite/gas/riscv/zba.s
 create mode 100644 gas/testsuite/gas/riscv/zbb-64.d
 create mode 100644 gas/testsuite/gas/riscv/zbb.d
 create mode 100644 gas/testsuite/gas/riscv/zbb.s
 create mode 100644 gas/testsuite/gas/riscv/zbc.d
 create mode 100644 gas/testsuite/gas/riscv/zbc.s
 create mode 100644 gas/testsuite/gas/riscv/zbs-64.d
 create mode 100644 gas/testsuite/gas/riscv/zbs.d
 create mode 100644 gas/testsuite/gas/riscv/zbs.s
 create mode 100644 gas/testsuite/gas/riscv/zkr.d
 create mode 100644 gas/testsuite/gas/riscv/zkr.s
 create mode 100644 gas/testsuite/gas/riscv/zkt.d


base-commit: 8e037eae6823caf5b9cb5b4feb3de838abb25956
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] RISC-V: Reorganize "K"-related subextension tests
  2022-09-23  7:49 [PATCH 0/2] RISC-V: Use only real extension names on testsuite Tsukasa OI
@ 2022-09-23  7:49 ` Tsukasa OI
  2022-09-23  7:49 ` [PATCH 2/2] RISC-V: Reorganize "B"-related " Tsukasa OI
  2022-10-25 14:54 ` [PATCH 0/2] RISC-V: Use only real extension names on testsuite Tsukasa OI
  2 siblings, 0 replies; 4+ messages in thread
From: Tsukasa OI @ 2022-09-23  7:49 UTC (permalink / raw)
  To: Tsukasa OI, Nelson Chu, Kito Cheng, Palmer Dabbelt; +Cc: binutils

As all cryptography-related instruction testcases are defined in other
files (zk*.[sd], zbk*.[sd]), there's no need to k-ext{,-64} themselves
except 'Zkt' and 'Zkr'.  Note that accessing seed CSR currently requires
'Zicsr', not just 'Zkr'.  This is being discussed.

After adding them, k-ext{,-64} tests can be safely removed.

Because "K" major extension itself will not be defined, removing these
tests can be useful to avoid confusion related to non-existent
"K"-extension.

gas/ChangeLog:

	* testsuite/gas/riscv/k-ext-64.d: Removed.
	* testsuite/gas/riscv/k-ext-64.s: Removed.
	* testsuite/gas/riscv/k-ext.d: Removed.
	* testsuite/gas/riscv/k-ext.s: Removed.
	* testsuite/gas/riscv/zkr.s: Separate test for
	the 'Zkr' extension.
	* testsuite/gas/riscv/zkr.d: Likewise.
	* testsuite/gas/riscv/zkt.d: Separate test for
	the 'Zkt' extension.
---
 gas/testsuite/gas/riscv/k-ext-64.d | 47 ------------------------------
 gas/testsuite/gas/riscv/k-ext-64.s | 38 ------------------------
 gas/testsuite/gas/riscv/k-ext.d    | 44 ----------------------------
 gas/testsuite/gas/riscv/k-ext.s    | 35 ----------------------
 gas/testsuite/gas/riscv/zkr.d      | 10 +++++++
 gas/testsuite/gas/riscv/zkr.s      |  2 ++
 gas/testsuite/gas/riscv/zkt.d      |  5 ++++
 7 files changed, 17 insertions(+), 164 deletions(-)
 delete mode 100644 gas/testsuite/gas/riscv/k-ext-64.d
 delete mode 100644 gas/testsuite/gas/riscv/k-ext-64.s
 delete mode 100644 gas/testsuite/gas/riscv/k-ext.d
 delete mode 100644 gas/testsuite/gas/riscv/k-ext.s
 create mode 100644 gas/testsuite/gas/riscv/zkr.d
 create mode 100644 gas/testsuite/gas/riscv/zkr.s
 create mode 100644 gas/testsuite/gas/riscv/zkt.d

diff --git a/gas/testsuite/gas/riscv/k-ext-64.d b/gas/testsuite/gas/riscv/k-ext-64.d
deleted file mode 100644
index 3237c95b199..00000000000
--- a/gas/testsuite/gas/riscv/k-ext-64.d
+++ /dev/null
@@ -1,47 +0,0 @@
-#as: -march=rv64i_zbkb_zbkc_zbkx_zknd_zkne_zknh_zkr_zksed_zksh_zkt
-#source: k-ext-64.s
-#objdump: -d
-
-.*:[ 	]+file format .*
-
-
-Disassembly of section .text:
-
-0+000 <target>:
-[ 	]+[0-9a-f]+:[ 	]+60c5d533[ 	]+ror[ 	]+a0,a1,a2
-[ 	]+[0-9a-f]+:[ 	]+60c59533[ 	]+rol[ 	]+a0,a1,a2
-[ 	]+[0-9a-f]+:[ 	]+6025d513[ 	]+rori[ 	]+a0,a1,0x2
-[ 	]+[0-9a-f]+:[ 	]+60c5d53b[ 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:[ 	]+32c58533[ 	]+aes64es[ 	]+a0,a1,a2
-[ 	]+[0-9a-f]+:[ 	]+36c58533[ 	]+aes64esm[ 	]+a0,a1,a2
-[ 	]+[0-9a-f]+:[ 	]+10251513[ 	]+sha256sig0[ 	]+a0,a0
-[ 	]+[0-9a-f]+:[ 	]+10351513[ 	]+sha256sig1[ 	]+a0,a0
-[ 	]+[0-9a-f]+:[ 	]+10051513[ 	]+sha256sum0[ 	]+a0,a0
-[ 	]+[0-9a-f]+:[ 	]+10151513[ 	]+sha256sum1[ 	]+a0,a0
-[ 	]+[0-9a-f]+:[ 	]+10651513[ 	]+sha512sig0[ 	]+a0,a0
-[ 	]+[0-9a-f]+:[ 	]+10751513[ 	]+sha512sig1[ 	]+a0,a0
-[ 	]+[0-9a-f]+:[ 	]+10451513[ 	]+sha512sum0[ 	]+a0,a0
-[ 	]+[0-9a-f]+:[ 	]+10551513[ 	]+sha512sum1[ 	]+a0,a0
-[ 	]+[0-9a-f]+:[ 	]+b0c58533[ 	]+sm4ed[ 	]+a0,a1,a2,0x2
-[ 	]+[0-9a-f]+:[ 	]+b4c58533[ 	]+sm4ks[ 	]+a0,a1,a2,0x2
-[ 	]+[0-9a-f]+:[ 	]+10851513[ 	]+sm3p0[ 	]+a0,a0
-[ 	]+[0-9a-f]+:[ 	]+10951513[ 	]+sm3p1[ 	]+a0,a0
diff --git a/gas/testsuite/gas/riscv/k-ext-64.s b/gas/testsuite/gas/riscv/k-ext-64.s
deleted file mode 100644
index 302b82ea005..00000000000
--- a/gas/testsuite/gas/riscv/k-ext-64.s
+++ /dev/null
@@ -1,38 +0,0 @@
-target:
-        ror     a0, a1, a2
-        rol     a0, a1, a2
-        rori    a0, a1, 2
-        rorw    a0, a1, a2
-        rolw    a0, a1, a2
-        roriw   a0, a1, 2
-        andn    a0, a1, a2
-        orn     a0, a1, a2
-        xnor    a0, a1, a2
-        pack    a0, a1, a2
-        packh   a0, a1, a2
-        packw   a0, a1, a2
-        brev8   a0, a0
-        rev8    a0, a0
-        clmul   a0, a1, a2
-        clmulh  a0, a1, a2
-        xperm4  a0, a1, a2
-        xperm8  a0, a1, a2
-        aes64ds     a0, a1, a2
-        aes64dsm    a0, a1, a2
-        aes64im     a0, a0
-        aes64ks1i   a0, a1, 4
-        aes64ks2    a0, a1, a2
-        aes64es     a0, a1, a2
-        aes64esm    a0, a1, a2
-        sha256sig0  a0, a0
-        sha256sig1  a0, a0
-        sha256sum0  a0, a0
-        sha256sum1  a0, a0
-        sha512sig0  a0, a0
-        sha512sig1  a0, a0
-        sha512sum0  a0, a0
-        sha512sum1  a0, a0
-        sm4ed   a0, a1, a2, 2
-        sm4ks   a0, a1, a2, 2
-        sm3p0   a0, a0
-        sm3p1   a0, a0
diff --git a/gas/testsuite/gas/riscv/k-ext.d b/gas/testsuite/gas/riscv/k-ext.d
deleted file mode 100644
index 57a720b60e3..00000000000
--- a/gas/testsuite/gas/riscv/k-ext.d
+++ /dev/null
@@ -1,44 +0,0 @@
-#as: -march=rv32i_zbkb_zbkc_zbkx_zknd_zkne_zknh_zkr_zksed_zksh_zkt
-#source: k-ext.s
-#objdump: -d
-
-.*:[ 	]+file format .*
-
-
-Disassembly of section .text:
-
-0+000 <target>:
-[ 	]+[0-9a-f]+:[ 	]+60c5d533[ 	]+ror[ 	]+a0,a1,a2
-[ 	]+[0-9a-f]+:[ 	]+60c59533[ 	]+rol[ 	]+a0,a1,a2
-[ 	]+[0-9a-f]+:[ 	]+6025d513[ 	]+rori[ 	]+a0,a1,0x2
-[ 	]+[0-9a-f]+:[ 	]+40c5f533[ 	]+andn[ 	]+a0,a1,a2
-[ 	]+[0-9a-f]+:[ 	]+40c5e533[ 	]+orn[ 	]+a0,a1,a2
-[ 	]+[0-9a-f]+:[ 	]+40c5c533[ 	]+xnor[ 	]+a0,a1,a2
-[ 	]+[0-9a-f]+:[ 	]+08c5c533[ 	]+pack[ 	]+a0,a1,a2
-[ 	]+[0-9a-f]+:[ 	]+08c5f533[ 	]+packh[ 	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a-f]+:[ 	]+56c58533[ 	]+sha512sig1l[ 	]+a0,a1,a2
-[ 	]+[0-9a-f]+:[ 	]+50c58533[ 	]+sha512sum0r[ 	]+a0,a1,a2
-[ 	]+[0-9a-f]+:[ 	]+52c58533[ 	]+sha512sum1r[ 	]+a0,a1,a2
-[ 	]+[0-9a-f]+:[ 	]+b0c58533[ 	]+sm4ed[ 	]+a0,a1,a2,0x2
-[ 	]+[0-9a-f]+:[ 	]+b4c58533[ 	]+sm4ks[ 	]+a0,a1,a2,0x2
-[ 	]+[0-9a-f]+:[ 	]+10851513[ 	]+sm3p0[ 	]+a0,a0
-[ 	]+[0-9a-f]+:[ 	]+10951513[ 	]+sm3p1[ 	]+a0,a0
diff --git a/gas/testsuite/gas/riscv/k-ext.s b/gas/testsuite/gas/riscv/k-ext.s
deleted file mode 100644
index 8eb27684710..00000000000
--- a/gas/testsuite/gas/riscv/k-ext.s
+++ /dev/null
@@ -1,35 +0,0 @@
-target:
-        ror     a0, a1, a2
-        rol     a0, a1, a2
-        rori    a0, a1, 2
-        andn    a0, a1, a2
-        orn     a0, a1, a2
-        xnor    a0, a1, a2
-        pack    a0, a1, a2
-        packh   a0, a1, a2
-        brev8   a0, a0
-        rev8    a0, a0
-        zip     a0, a0
-        unzip   a0, a0
-        clmul   a0, a1, a2
-        clmulh  a0, a1, a2
-        xperm4  a0, a1, a2
-        xperm8  a0, a1, a2
-        aes32dsi    a0, a1, a2, 2
-        aes32dsmi   a0, a1, a2, 2
-        aes32esi    a0, a1, a2, 2
-        aes32esmi   a0, a1, a2, 2
-        sha256sig0  a0, a0
-        sha256sig1  a0, a0
-        sha256sum0  a0, a0
-        sha256sum1  a0, a0
-        sha512sig0h    a0, a1, a2
-        sha512sig0l    a0, a1, a2
-        sha512sig1h    a0, a1, a2
-        sha512sig1l    a0, a1, a2
-        sha512sum0r    a0, a1, a2
-        sha512sum1r    a0, a1, a2
-        sm4ed   a0, a1, a2, 2
-        sm4ks   a0, a1, a2, 2
-        sm3p0   a0, a0
-        sm3p1   a0, a0
diff --git a/gas/testsuite/gas/riscv/zkr.d b/gas/testsuite/gas/riscv/zkr.d
new file mode 100644
index 00000000000..4d72c26aac0
--- /dev/null
+++ b/gas/testsuite/gas/riscv/zkr.d
@@ -0,0 +1,10 @@
+#as: -march=rv32i_zicsr_zkr -mcsr-check
+#objdump: -d
+
+.*:[ 	]+file format .*
+
+
+Disassembly of section .text:
+
+0+000 <target>:
+[ 	]+[0-9a-f]+:[ 	]+01502573[ 	]+csrr[ 	]+a0,seed
diff --git a/gas/testsuite/gas/riscv/zkr.s b/gas/testsuite/gas/riscv/zkr.s
new file mode 100644
index 00000000000..96a38fbf49f
--- /dev/null
+++ b/gas/testsuite/gas/riscv/zkr.s
@@ -0,0 +1,2 @@
+target:
+	csrr	a0, seed
diff --git a/gas/testsuite/gas/riscv/zkt.d b/gas/testsuite/gas/riscv/zkt.d
new file mode 100644
index 00000000000..feca41b64fa
--- /dev/null
+++ b/gas/testsuite/gas/riscv/zkt.d
@@ -0,0 +1,5 @@
+#as: -march=rv32i_zkt
+#source: empty.s
+#objdump: -d
+
+#...
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] RISC-V: Reorganize "B"-related subextension tests
  2022-09-23  7:49 [PATCH 0/2] RISC-V: Use only real extension names on testsuite Tsukasa OI
  2022-09-23  7:49 ` [PATCH 1/2] RISC-V: Reorganize "K"-related subextension tests Tsukasa OI
@ 2022-09-23  7:49 ` Tsukasa OI
  2022-10-25 14:54 ` [PATCH 0/2] RISC-V: Use only real extension names on testsuite Tsukasa OI
  2 siblings, 0 replies; 4+ messages in thread
From: Tsukasa OI @ 2022-09-23  7:49 UTC (permalink / raw)
  To: Tsukasa OI, Nelson Chu, Kito Cheng, Palmer Dabbelt; +Cc: binutils

As all bit manipulation instructions are defined in multiple subextensions,
this commit will split "B" tests into separate subextension tests.

Because "B" major extension itself will not be defined, splitting and moving
these tests can be useful to avoid confusion related to non-existent
"B"-extension.

It's also better to split these because of counterintuitive grouping of
an instruction alias.  For instance, "zext.h" is a part of 'Zbb' but
"zext.w" is a specialized form of "add.uw",
which is a part of 'Zba' (RV64 only).

Separating these tests to per-subextension makes instruction tests more
complete.

gas/ChangeLog:

	* testsuite/gas/riscv/b-ext.d: Removed.
	* testsuite/gas/riscv/b-ext.s: Removed.
	* testsuite/gas/riscv/b-ext-64.d: Removed.
	* testsuite/gas/riscv/b-ext-64.s: Removed.
	* testsuite/gas/riscv/zba.s: Splitted from b-ext.s and b-ext-64.s.
	* testsuite/gas/riscv/zbb.s: Likewise.
	* testsuite/gas/riscv/zbc.s: Likewise.
	* testsuite/gas/riscv/zbs.s: Likewise.
	* testsuite/gas/riscv/zba.d: Splitted from b-ext.d and b-ext-64.d.
	* testsuite/gas/riscv/zbb.d: Likewise.
	* testsuite/gas/riscv/zbc.d: Likewise.
	* testsuite/gas/riscv/zbs.d: Likewise.
	* testsuite/gas/riscv/zba-64.d: Splitted from b-ext-64.d.
	* testsuite/gas/riscv/zbb-64.d: Likewise.
	* testsuite/gas/riscv/zbs-64.d: Likewise.
---
 gas/testsuite/gas/riscv/b-ext-64.d | 72 ------------------------------
 gas/testsuite/gas/riscv/b-ext-64.s | 64 --------------------------
 gas/testsuite/gas/riscv/b-ext.d    | 51 ---------------------
 gas/testsuite/gas/riscv/b-ext.s    | 43 ------------------
 gas/testsuite/gas/riscv/zba-64.d   | 19 ++++++++
 gas/testsuite/gas/riscv/zba.d      | 12 +++++
 gas/testsuite/gas/riscv/zba.s      | 14 ++++++
 gas/testsuite/gas/riscv/zbb-64.d   | 36 +++++++++++++++
 gas/testsuite/gas/riscv/zbb.d      | 28 ++++++++++++
 gas/testsuite/gas/riscv/zbb.s      | 34 ++++++++++++++
 gas/testsuite/gas/riscv/zbc.d      | 12 +++++
 gas/testsuite/gas/riscv/zbc.s      |  4 ++
 gas/testsuite/gas/riscv/zbs-64.d   | 34 ++++++++++++++
 gas/testsuite/gas/riscv/zbs.d      | 25 +++++++++++
 gas/testsuite/gas/riscv/zbs.s      | 32 +++++++++++++
 15 files changed, 250 insertions(+), 230 deletions(-)
 delete mode 100644 gas/testsuite/gas/riscv/b-ext-64.d
 delete mode 100644 gas/testsuite/gas/riscv/b-ext-64.s
 delete mode 100644 gas/testsuite/gas/riscv/b-ext.d
 delete mode 100644 gas/testsuite/gas/riscv/b-ext.s
 create mode 100644 gas/testsuite/gas/riscv/zba-64.d
 create mode 100644 gas/testsuite/gas/riscv/zba.d
 create mode 100644 gas/testsuite/gas/riscv/zba.s
 create mode 100644 gas/testsuite/gas/riscv/zbb-64.d
 create mode 100644 gas/testsuite/gas/riscv/zbb.d
 create mode 100644 gas/testsuite/gas/riscv/zbb.s
 create mode 100644 gas/testsuite/gas/riscv/zbc.d
 create mode 100644 gas/testsuite/gas/riscv/zbc.s
 create mode 100644 gas/testsuite/gas/riscv/zbs-64.d
 create mode 100644 gas/testsuite/gas/riscv/zbs.d
 create mode 100644 gas/testsuite/gas/riscv/zbs.s

diff --git a/gas/testsuite/gas/riscv/b-ext-64.d b/gas/testsuite/gas/riscv/b-ext-64.d
deleted file mode 100644
index 9b6e6b7ab2a..00000000000
--- a/gas/testsuite/gas/riscv/b-ext-64.d
+++ /dev/null
@@ -1,72 +0,0 @@
-#as: -march=rv64i_zba_zbb_zbc_zbs
-#source: b-ext-64.s
-#objdump: -d
-
-.*:[ 	]+file format .*
-
-
-Disassembly of section .text:
-
-0+000 <target>:
-[ 	]+0:[ 	]+60051513[ 	]+clz[ 	]+a0,a0
-[ 	]+4:[ 	]+60151513[ 	]+ctz[ 	]+a0,a0
-[ 	]+8:[ 	]+60251513[ 	]+cpop[ 	]+a0,a0
-[ 	]+c:[ 	]+0ac5c533[ 	]+min[ 	]+a0,a1,a2
-[ 	]+10:[ 	]+0ac5d533[ 	]+minu[ 	]+a0,a1,a2
-[ 	]+14:[ 	]+0ac5e533[ 	]+max[ 	]+a0,a1,a2
-[ 	]+18:[ 	]+0ac5f533[ 	]+maxu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 	]+a0,a1,a2
-[ 	]+[0-9a-f]+:[ 	]+28c59533[ 	]+bset[ 	]+a0,a1,a2
-[ 	]+[0-9a-f]+:[ 	]+68c59533[ 	]+binv[ 	]+a0,a1,a2
-[ 	]+[0-9a-f]+:[ 	]+48c5d533[ 	]+bext[ 	]+a0,a1,a2
-[ 	]+[0-9a-f]+:[ 	]+49f59513[ 	]+bclri[ 	]+a0,a1,0x1f
-[ 	]+[0-9a-f]+:[ 	]+29f59513[ 	]+bseti[ 	]+a0,a1,0x1f
-[ 	]+[0-9a-f]+:[ 	]+69f59513[ 	]+binvi[ 	]+a0,a1,0x1f
-[ 	]+[0-9a-f]+:[ 	]+49f5d513[ 	]+bexti[ 	]+a0,a1,0x1f
-[ 	]+[0-9a-f]+:[ 	]+4bf59513[ 	]+bclri[ 	]+a0,a1,0x3f
-[ 	]+[0-9a-f]+:[ 	]+2bf59513[ 	]+bseti[ 	]+a0,a1,0x3f
-[ 	]+[0-9a-f]+:[ 	]+6bf59513[ 	]+binvi[ 	]+a0,a1,0x3f
-[ 	]+[0-9a-f]+:[ 	]+4bf5d513[ 	]+bexti[ 	]+a0,a1,0x3f
diff --git a/gas/testsuite/gas/riscv/b-ext-64.s b/gas/testsuite/gas/riscv/b-ext-64.s
deleted file mode 100644
index 57e501e9a41..00000000000
--- a/gas/testsuite/gas/riscv/b-ext-64.s
+++ /dev/null
@@ -1,64 +0,0 @@
-target:
-	clz	a0, a0
-	ctz	a0, a0
-	cpop	a0, a0
-	min	a0, a1, a2
-	minu	a0, a1, a2
-	max	a0, a1, a2
-	maxu	a0, a1, a2
-	sext.b	a0, a0
-	sext.h	a0, a0
-	zext.h	a0, a0
-	andn	a0, a1, a2
-	orn	a0, a1, a2
-	xnor	a0, a1, a2
-	rol	a0, a1, a2
-	ror	a0, a1, a2
-	ror	a0, a1, 2
-	rori	a0, a1, 2
-	rev8	a0, a0
-	orc.b	a0, a0
-	sh1add	a0, a1, a2
-	sh2add	a0, a1, a2
-	sh3add	a0, a1, a2
-	clmul	a0, a1, a2
-	clmulh	a0, a1, a2
-	clmulr	a0, a1, a2
-	clzw	a0, a0
-	ctzw	a0, a0
-	cpopw	a0, a0
-	rolw	a0, a1, a2
-	rorw	a0, a1, a2
-	rorw	a0, a1, 2
-	roriw	a0, a1, 2
-	sh1add.uw	a0, a1, a2
-	sh2add.uw	a0, a1, a2
-	sh3add.uw	a0, a1, a2
-	add.uw	a0, a1, a2
-	zext.w	a0, a1
-	slli.uw	a0, a1, 2
-	bclri   a0, a1, 0
-	bclri   a0, a1, 31
-	bseti   a0, a1, 0
-	bseti   a0, a1, 31
-	binvi   a0, a1, 0
-	binvi   a0, a1, 31
-	bexti   a0, a1, 0
-	bexti   a0, a1, 31
-	bclri   a0, a1, 63
-	bseti   a0, a1, 63
-	binvi   a0, a1, 63
-	bexti   a0, a1, 63
-	bclr    a0, a1, a2
-	bset    a0, a1, a2
-	binv    a0, a1, a2
-	bext    a0, a1, a2
-	#aliases
-	bclr    a0, a1, 31
-	bset    a0, a1, 31
-	binv    a0, a1, 31
-	bext    a0, a1, 31
-	bclr    a0, a1, 63
-	bset    a0, a1, 63
-	binv    a0, a1, 63
-	bext    a0, a1, 63
diff --git a/gas/testsuite/gas/riscv/b-ext.d b/gas/testsuite/gas/riscv/b-ext.d
deleted file mode 100644
index c1c5f918a84..00000000000
--- a/gas/testsuite/gas/riscv/b-ext.d
+++ /dev/null
@@ -1,51 +0,0 @@
-#as: -march=rv32i_zba_zbb_zbc_zbs
-#source: b-ext.s
-#objdump: -d
-
-.*:[ 	]+file format .*
-
-
-Disassembly of section .text:
-
-0+000 <target>:
-[ 	]+0:[ 	]+60051513[ 	]+clz[ 	]+a0,a0
-[ 	]+4:[ 	]+60151513[ 	]+ctz[ 	]+a0,a0
-[ 	]+8:[ 	]+60251513[ 	]+cpop[ 	]+a0,a0
-[ 	]+c:[ 	]+0ac5c533[ 	]+min[ 	]+a0,a1,a2
-[ 	]+10:[ 	]+0ac5d533[ 	]+minu[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,a1,0x0
-[ 	]+[0-9a-f]+:[ 	]+29f59513[ 	]+bseti[ 	]+a0,a1,0x1f
-[ 	]+[0-9a-f]+:[ 	]+68059513[ 	]+binvi[ 	]+a0,a1,0x0
-[ 	]+[0-9a-f]+:[ 	]+69f59513[ 	]+binvi[ 	]+a0,a1,0x1f
-[ 	]+[0-9a-f]+:[ 	]+4805d513[ 	]+bexti[ 	]+a0,a1,0x0
-[ 	]+[0-9a-f]+:[ 	]+49f5d513[ 	]+bexti[ 	]+a0,a1,0x1f
-[ 	]+[0-9a-f]+:[ 	]+48c59533[ 	]+bclr[ 	]+a0,a1,a2
-[ 	]+[0-9a-f]+:[ 	]+28c59533[ 	]+bset[ 	]+a0,a1,a2
-[ 	]+[0-9a-f]+:[ 	]+68c59533[ 	]+binv[ 	]+a0,a1,a2
-[ 	]+[0-9a-f]+:[ 	]+48c5d533[ 	]+bext[ 	]+a0,a1,a2
-[ 	]+[0-9a-f]+:[ 	]+49f59513[ 	]+bclri[ 	]+a0,a1,0x1f
-[ 	]+[0-9a-f]+:[ 	]+29f59513[ 	]+bseti[ 	]+a0,a1,0x1f
-[ 	]+[0-9a-f]+:[ 	]+69f59513[ 	]+binvi[ 	]+a0,a1,0x1f
-[ 	]+[0-9a-f]+:[ 	]+49f5d513[ 	]+bexti[ 	]+a0,a1,0x1f
diff --git a/gas/testsuite/gas/riscv/b-ext.s b/gas/testsuite/gas/riscv/b-ext.s
deleted file mode 100644
index 9de3fc32806..00000000000
--- a/gas/testsuite/gas/riscv/b-ext.s
+++ /dev/null
@@ -1,43 +0,0 @@
-target:
-	clz	a0, a0
-	ctz	a0, a0
-	cpop	a0, a0
-	min	a0, a1, a2
-	minu	a0, a1, a2
-	max	a0, a1, a2
-	maxu	a0, a1, a2
-	sext.b	a0, a0
-	sext.h	a0, a0
-	zext.h	a0, a0
-	andn	a0, a1, a2
-	orn	a0, a1, a2
-	xnor	a0, a1, a2
-	rol	a0, a1, a2
-	ror	a0, a1, a2
-	ror	a0, a1, 2
-	rori	a0, a1, 2
-	rev8	a0, a0
-	orc.b	a0, a0
-	sh1add	a0, a1, a2
-	sh2add	a0, a1, a2
-	sh3add	a0, a1, a2
-	clmul	a0, a1, a2
-	clmulh	a0, a1, a2
-	clmulr	a0, a1, a2
-	bclri   a0, a1, 0
-	bclri   a0, a1, 31
-	bseti   a0, a1, 0
-	bseti   a0, a1, 31
-	binvi   a0, a1, 0
-	binvi   a0, a1, 31
-	bexti   a0, a1, 0
-	bexti   a0, a1, 31
-	bclr    a0, a1, a2
-	bset    a0, a1, a2
-	binv    a0, a1, a2
-	bext    a0, a1, a2
-	#aliases
-	bclr    a0, a1, 31
-	bset    a0, a1, 31
-	binv    a0, a1, 31
-	bext    a0, a1, 31
diff --git a/gas/testsuite/gas/riscv/zba-64.d b/gas/testsuite/gas/riscv/zba-64.d
new file mode 100644
index 00000000000..957787e18c6
--- /dev/null
+++ b/gas/testsuite/gas/riscv/zba-64.d
@@ -0,0 +1,19 @@
+#as: -march=rv64i_zba -defsym rv64=1
+#source: zba.s
+#objdump: -d
+
+.*:[ 	]+file format .*
+
+
+Disassembly of section .text:
+
+0+000 <target>:
+[ 	]+[0-9a-f]+:[ 	]+20c5a533[ 	]+sh1add[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+20c5c533[ 	]+sh2add[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+20c5e533[ 	]+sh3add[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+20c5a53b[ 	]+sh1add\.uw[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+20c5c53b[ 	]+sh2add\.uw[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+20c5e53b[ 	]+sh3add\.uw[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+08c5853b[ 	]+add.uw[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+0825951b[ 	]+slli.uw[ 	]+a0,a1,0x2
+[ 	]+[0-9a-f]+:[ 	]+0805853b[ 	]+zext.w[ 	]+a0,a1
diff --git a/gas/testsuite/gas/riscv/zba.d b/gas/testsuite/gas/riscv/zba.d
new file mode 100644
index 00000000000..3ab7201034c
--- /dev/null
+++ b/gas/testsuite/gas/riscv/zba.d
@@ -0,0 +1,12 @@
+#as: -march=rv32i_zba
+#objdump: -d
+
+.*:[ 	]+file format .*
+
+
+Disassembly of section .text:
+
+0+000 <target>:
+[ 	]+[0-9a-f]+:[ 	]+20c5a533[ 	]+sh1add[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+20c5c533[ 	]+sh2add[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+20c5e533[ 	]+sh3add[ 	]+a0,a1,a2
diff --git a/gas/testsuite/gas/riscv/zba.s b/gas/testsuite/gas/riscv/zba.s
new file mode 100644
index 00000000000..8fcf04054c0
--- /dev/null
+++ b/gas/testsuite/gas/riscv/zba.s
@@ -0,0 +1,14 @@
+target:
+	sh1add		a0, a1, a2
+	sh2add		a0, a1, a2
+	sh3add		a0, a1, a2
+.ifdef rv64
+	sh1add.uw	a0, a1, a2
+	sh2add.uw	a0, a1, a2
+	sh3add.uw	a0, a1, a2
+	add.uw		a0, a1, a2
+	slli.uw		a0, a1, 2
+
+	# Aliases
+	zext.w		a0, a1
+.endif
diff --git a/gas/testsuite/gas/riscv/zbb-64.d b/gas/testsuite/gas/riscv/zbb-64.d
new file mode 100644
index 00000000000..88ab8db862c
--- /dev/null
+++ b/gas/testsuite/gas/riscv/zbb-64.d
@@ -0,0 +1,36 @@
+#as: -march=rv64i_zbb -defsym rv64=1
+#source: zbb.s
+#objdump: -d
+
+.*:[ 	]+file format .*
+
+
+Disassembly of section .text:
+
+0+000 <target>:
+[ 	]+[0-9a-f]+:[ 	]+60051513[ 	]+clz[  	]+a0,a0
+[ 	]+[0-9a-f]+:[ 	]+60151513[ 	]+ctz[  	]+a0,a0
+[ 	]+[0-9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w[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+6025d51b[ 	]+roriw[ 	]+a0,a1,0x2
+[ 	]+[0-9a-f]+:[ 	]+6025d513[ 	]+rori[ 	]+a0,a1,0x2
+[ 	]+[0-9a-f]+:[ 	]+6025d51b[ 	]+roriw[ 	]+a0,a1,0x2
diff --git a/gas/testsuite/gas/riscv/zbb.d b/gas/testsuite/gas/riscv/zbb.d
new file mode 100644
index 00000000000..67f4d65e171
--- /dev/null
+++ b/gas/testsuite/gas/riscv/zbb.d
@@ -0,0 +1,28 @@
+#as: -march=rv32i_zbb
+#objdump: -d
+
+.*:[ 	]+file format .*
+
+
+Disassembly of section .text:
+
+0+000 <target>:
+[ 	]+[0-9a-f]+:[ 	]+60051513[ 	]+clz[  	]+a0,a0
+[ 	]+[0-9a-f]+:[ 	]+60151513[ 	]+ctz[  	]+a0,a0
+[ 	]+[0-9a-f]+:[ 	]+60251513[ 	]+cpop[ 	]+a0,a0
+[ 	]+[0-9a-f]+:[ 	]+0ac5c533[ 	]+min[  	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+0ac5d533[ 	]+minu[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+0ac5e533[ 	]+max[  	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+0ac5f533[ 	]+maxu[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+60451513[ 	]+sext.b[ 	]+a0,a0
+[ 	]+[0-9a-f]+:[ 	]+60551513[ 	]+sext.h[ 	]+a0,a0
+[ 	]+[0-9a-f]+:[ 	]+08054533[ 	]+zext.h[ 	]+a0,a0
+[ 	]+[0-9a-f]+:[ 	]+40c5f533[ 	]+andn[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+40c5e533[ 	]+orn[  	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+40c5c533[ 	]+xnor[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+60c59533[ 	]+rol[  	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+60c5d533[ 	]+ror[  	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+6025d513[ 	]+rori[ 	]+a0,a1,0x2
+[ 	]+[0-9a-f]+:[ 	]+69855513[ 	]+rev8[ 	]+a0,a0
+[ 	]+[0-9a-f]+:[ 	]+28755513[ 	]+orc.b[ 	]+a0,a0
+[ 	]+[0-9a-f]+:[ 	]+6025d513[ 	]+rori[ 	]+a0,a1,0x2
diff --git a/gas/testsuite/gas/riscv/zbb.s b/gas/testsuite/gas/riscv/zbb.s
new file mode 100644
index 00000000000..e25acde18b7
--- /dev/null
+++ b/gas/testsuite/gas/riscv/zbb.s
@@ -0,0 +1,34 @@
+target:
+	clz	a0, a0
+	ctz	a0, a0
+	cpop	a0, a0
+	min	a0, a1, a2
+	minu	a0, a1, a2
+	max	a0, a1, a2
+	maxu	a0, a1, a2
+	sext.b	a0, a0
+	sext.h	a0, a0
+	zext.h	a0, a0
+	andn	a0, a1, a2
+	orn	a0, a1, a2
+	xnor	a0, a1, a2
+	rol	a0, a1, a2
+	ror	a0, a1, a2
+	rori	a0, a1, 2
+	rev8	a0, a0
+	orc.b	a0, a0
+
+.ifdef rv64
+	clzw	a0, a0
+	ctzw	a0, a0
+	cpopw	a0, a0
+	rolw	a0, a1, a2
+	rorw	a0, a1, a2
+	roriw	a0, a1, 2
+.endif
+
+	# Aliases
+	ror	a0, a1, 2
+.ifdef rv64
+	rorw	a0, a1, 2
+.endif
diff --git a/gas/testsuite/gas/riscv/zbc.d b/gas/testsuite/gas/riscv/zbc.d
new file mode 100644
index 00000000000..a5377222329
--- /dev/null
+++ b/gas/testsuite/gas/riscv/zbc.d
@@ -0,0 +1,12 @@
+#as: -march=rv32i_zbc
+#objdump: -d
+
+.*:[ 	]+file format .*
+
+
+Disassembly of section .text:
+
+0+000 <target>:
+[ 	]+[0-9a-f]+:[ 	]+0ac59533[ 	]+clmul[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+0ac5b533[ 	]+clmulh[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+0ac5a533[ 	]+clmulr[ 	]+a0,a1,a2
diff --git a/gas/testsuite/gas/riscv/zbc.s b/gas/testsuite/gas/riscv/zbc.s
new file mode 100644
index 00000000000..65b9edc090d
--- /dev/null
+++ b/gas/testsuite/gas/riscv/zbc.s
@@ -0,0 +1,4 @@
+target:
+	clmul	a0, a1, a2
+	clmulh	a0, a1, a2
+	clmulr	a0, a1, a2
diff --git a/gas/testsuite/gas/riscv/zbs-64.d b/gas/testsuite/gas/riscv/zbs-64.d
new file mode 100644
index 00000000000..e3ac1dde39b
--- /dev/null
+++ b/gas/testsuite/gas/riscv/zbs-64.d
@@ -0,0 +1,34 @@
+#as: -march=rv64i_zbs -defsym rv64=1
+#source: zbs.s
+#objdump: -d
+
+.*:[ 	]+file format .*
+
+
+Disassembly of section .text:
+
+0+000 <target>:
+[ 	]+[0-9a-f]+:[ 	]+48059513[ 	]+bclri[ 	]+a0,a1,0x0
+[ 	]+[0-9a-f]+:[ 	]+49f59513[ 	]+bclri[ 	]+a0,a1,0x1f
+[ 	]+[0-9a-f]+:[ 	]+28059513[ 	]+bseti[ 	]+a0,a1,0x0
+[ 	]+[0-9a-f]+:[ 	]+29f59513[ 	]+bseti[ 	]+a0,a1,0x1f
+[ 	]+[0-9a-f]+:[ 	]+68059513[ 	]+binvi[ 	]+a0,a1,0x0
+[ 	]+[0-9a-f]+:[ 	]+69f59513[ 	]+binvi[ 	]+a0,a1,0x1f
+[ 	]+[0-9a-f]+:[ 	]+4805d513[ 	]+bexti[ 	]+a0,a1,0x0
+[ 	]+[0-9a-f]+:[ 	]+49f5d513[ 	]+bexti[ 	]+a0,a1,0x1f
+[ 	]+[0-9a-f]+:[ 	]+48c59533[ 	]+bclr[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+28c59533[ 	]+bset[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+68c59533[ 	]+binv[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+48c5d533[ 	]+bext[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+49f59513[ 	]+bclri[ 	]+a0,a1,0x1f
+[ 	]+[0-9a-f]+:[ 	]+29f59513[ 	]+bseti[ 	]+a0,a1,0x1f
+[ 	]+[0-9a-f]+:[ 	]+69f59513[ 	]+binvi[ 	]+a0,a1,0x1f
+[ 	]+[0-9a-f]+:[ 	]+49f5d513[ 	]+bexti[ 	]+a0,a1,0x1f
+[ 	]+[0-9a-f]+:[ 	]+4bf59513[ 	]+bclri[ 	]+a0,a1,0x3f
+[ 	]+[0-9a-f]+:[ 	]+2bf59513[ 	]+bseti[ 	]+a0,a1,0x3f
+[ 	]+[0-9a-f]+:[ 	]+6bf59513[ 	]+binvi[ 	]+a0,a1,0x3f
+[ 	]+[0-9a-f]+:[ 	]+4bf5d513[ 	]+bexti[ 	]+a0,a1,0x3f
+[ 	]+[0-9a-f]+:[ 	]+4bf59513[ 	]+bclri[ 	]+a0,a1,0x3f
+[ 	]+[0-9a-f]+:[ 	]+2bf59513[ 	]+bseti[ 	]+a0,a1,0x3f
+[ 	]+[0-9a-f]+:[ 	]+6bf59513[ 	]+binvi[ 	]+a0,a1,0x3f
+[ 	]+[0-9a-f]+:[ 	]+4bf5d513[ 	]+bexti[ 	]+a0,a1,0x3f
diff --git a/gas/testsuite/gas/riscv/zbs.d b/gas/testsuite/gas/riscv/zbs.d
new file mode 100644
index 00000000000..46d25109358
--- /dev/null
+++ b/gas/testsuite/gas/riscv/zbs.d
@@ -0,0 +1,25 @@
+#as: -march=rv32i_zbs
+#objdump: -d
+
+.*:[ 	]+file format .*
+
+
+Disassembly of section .text:
+
+0+000 <target>:
+[ 	]+[0-9a-f]+:[ 	]+48059513[ 	]+bclri[ 	]+a0,a1,0x0
+[ 	]+[0-9a-f]+:[ 	]+49f59513[ 	]+bclri[ 	]+a0,a1,0x1f
+[ 	]+[0-9a-f]+:[ 	]+28059513[ 	]+bseti[ 	]+a0,a1,0x0
+[ 	]+[0-9a-f]+:[ 	]+29f59513[ 	]+bseti[ 	]+a0,a1,0x1f
+[ 	]+[0-9a-f]+:[ 	]+68059513[ 	]+binvi[ 	]+a0,a1,0x0
+[ 	]+[0-9a-f]+:[ 	]+69f59513[ 	]+binvi[ 	]+a0,a1,0x1f
+[ 	]+[0-9a-f]+:[ 	]+4805d513[ 	]+bexti[ 	]+a0,a1,0x0
+[ 	]+[0-9a-f]+:[ 	]+49f5d513[ 	]+bexti[ 	]+a0,a1,0x1f
+[ 	]+[0-9a-f]+:[ 	]+48c59533[ 	]+bclr[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+28c59533[ 	]+bset[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+68c59533[ 	]+binv[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+48c5d533[ 	]+bext[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+49f59513[ 	]+bclri[ 	]+a0,a1,0x1f
+[ 	]+[0-9a-f]+:[ 	]+29f59513[ 	]+bseti[ 	]+a0,a1,0x1f
+[ 	]+[0-9a-f]+:[ 	]+69f59513[ 	]+binvi[ 	]+a0,a1,0x1f
+[ 	]+[0-9a-f]+:[ 	]+49f5d513[ 	]+bexti[ 	]+a0,a1,0x1f
diff --git a/gas/testsuite/gas/riscv/zbs.s b/gas/testsuite/gas/riscv/zbs.s
new file mode 100644
index 00000000000..5f152ced234
--- /dev/null
+++ b/gas/testsuite/gas/riscv/zbs.s
@@ -0,0 +1,32 @@
+target:
+	bclri	a0, a1, 0
+	bclri	a0, a1, 31
+	bseti	a0, a1, 0
+	bseti	a0, a1, 31
+	binvi	a0, a1, 0
+	binvi	a0, a1, 31
+	bexti	a0, a1, 0
+	bexti	a0, a1, 31
+	bclr	a0, a1, a2
+	bset	a0, a1, a2
+	binv	a0, a1, a2
+	bext	a0, a1, a2
+
+	# Aliases
+	bclr	a0, a1, 31
+	bset	a0, a1, 31
+	binv	a0, a1, 31
+	bext	a0, a1, 31
+
+.ifdef rv64
+	bclri	a0, a1, 63
+	bseti	a0, a1, 63
+	binvi	a0, a1, 63
+	bexti	a0, a1, 63
+
+	# Aliases
+	bclr	a0, a1, 63
+	bset	a0, a1, 63
+	binv	a0, a1, 63
+	bext	a0, a1, 63
+.endif
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] RISC-V: Use only real extension names on testsuite
  2022-09-23  7:49 [PATCH 0/2] RISC-V: Use only real extension names on testsuite Tsukasa OI
  2022-09-23  7:49 ` [PATCH 1/2] RISC-V: Reorganize "K"-related subextension tests Tsukasa OI
  2022-09-23  7:49 ` [PATCH 2/2] RISC-V: Reorganize "B"-related " Tsukasa OI
@ 2022-10-25 14:54 ` Tsukasa OI
  2 siblings, 0 replies; 4+ messages in thread
From: Tsukasa OI @ 2022-10-25 14:54 UTC (permalink / raw)
  To: Nelson Chu, Kito Cheng, Palmer Dabbelt; +Cc: binutils

Ping.

On 2022/09/23 16:49, Tsukasa OI wrote:
> Hi,
> 
> Most of the RISC-V GAS testsuite uses real extension names but there are a
> few counterexamples.  I will talk about following tests:
> 
> -   b-ext{,-64} for ("Zb*" except "Zbk*")
> -   k-ext{,-64} for ("Zk*" and "Zbk*")
> 
> They:
> -   provide unnecessary confusion (that major "B" and "K" extensions exist),
>     for example shown in:
>     <https://sourceware.org/bugzilla/show_bug.cgi?id=29341> and
> -   do not test separate extension
>     (they are multiple subextensions).
> 
> To avoid confusion and test individual extensions separately, this patchset
> provides per-extension testcases and removes b-ext{,-64} and k-ext{,-64}.
> 
> There's another effect.  Splitting "B" testcases will clarify that "zext.h"
> and "zext.w" (seemingly similar) instructions belong to different extension:
> 
> -   "zext.h" (RV32/64_Zbb)
> -   "zext.w" (RV64_Zba)  <-- not Zbb!
> 
> [Changes]
> 
> -   Split b-ext and b-ext-64 to:
>     -   zba{,-64}
>     -   zbb{,-64}
>     -   zbc
>     -   zbs{,-64}
> -   Reuse existing "zk*" and "zbk*" testcases because they are fine as is,
> -   Add new testcases for separate extension:
>     -   zkr (along with 'Zicsr', to test "seed" CSR accessibility)
>     -   zkt (just to test extension support)
> -   Remove:
>     -   b-ext{,-64}
>     -   k-ext{,-64}
> 
> For vector-insn*, I'll leave this for now but it might possible to split
> (e.g. to three testcases for two instruction classes and INSN_V_EEW64).
> Still, I think this is not as important as b-ext{,-64} and k-ext{,-64} and
> I don't complain about using vector-insn* names themselves.
> 
> Thanks,
> Tsukasa
> 
> 
> 
> 
> Tsukasa OI (2):
>   RISC-V: Reorganize "K"-related subextension tests
>   RISC-V: Reorganize "B"-related subextension tests
> 
>  gas/testsuite/gas/riscv/b-ext-64.d | 72 ------------------------------
>  gas/testsuite/gas/riscv/b-ext-64.s | 64 --------------------------
>  gas/testsuite/gas/riscv/b-ext.d    | 51 ---------------------
>  gas/testsuite/gas/riscv/b-ext.s    | 43 ------------------
>  gas/testsuite/gas/riscv/k-ext-64.d | 47 -------------------
>  gas/testsuite/gas/riscv/k-ext-64.s | 38 ----------------
>  gas/testsuite/gas/riscv/k-ext.d    | 44 ------------------
>  gas/testsuite/gas/riscv/k-ext.s    | 35 ---------------
>  gas/testsuite/gas/riscv/zba-64.d   | 19 ++++++++
>  gas/testsuite/gas/riscv/zba.d      | 12 +++++
>  gas/testsuite/gas/riscv/zba.s      | 14 ++++++
>  gas/testsuite/gas/riscv/zbb-64.d   | 36 +++++++++++++++
>  gas/testsuite/gas/riscv/zbb.d      | 28 ++++++++++++
>  gas/testsuite/gas/riscv/zbb.s      | 34 ++++++++++++++
>  gas/testsuite/gas/riscv/zbc.d      | 12 +++++
>  gas/testsuite/gas/riscv/zbc.s      |  4 ++
>  gas/testsuite/gas/riscv/zbs-64.d   | 34 ++++++++++++++
>  gas/testsuite/gas/riscv/zbs.d      | 25 +++++++++++
>  gas/testsuite/gas/riscv/zbs.s      | 32 +++++++++++++
>  gas/testsuite/gas/riscv/zkr.d      | 10 +++++
>  gas/testsuite/gas/riscv/zkr.s      |  2 +
>  gas/testsuite/gas/riscv/zkt.d      |  5 +++
>  22 files changed, 267 insertions(+), 394 deletions(-)
>  delete mode 100644 gas/testsuite/gas/riscv/b-ext-64.d
>  delete mode 100644 gas/testsuite/gas/riscv/b-ext-64.s
>  delete mode 100644 gas/testsuite/gas/riscv/b-ext.d
>  delete mode 100644 gas/testsuite/gas/riscv/b-ext.s
>  delete mode 100644 gas/testsuite/gas/riscv/k-ext-64.d
>  delete mode 100644 gas/testsuite/gas/riscv/k-ext-64.s
>  delete mode 100644 gas/testsuite/gas/riscv/k-ext.d
>  delete mode 100644 gas/testsuite/gas/riscv/k-ext.s
>  create mode 100644 gas/testsuite/gas/riscv/zba-64.d
>  create mode 100644 gas/testsuite/gas/riscv/zba.d
>  create mode 100644 gas/testsuite/gas/riscv/zba.s
>  create mode 100644 gas/testsuite/gas/riscv/zbb-64.d
>  create mode 100644 gas/testsuite/gas/riscv/zbb.d
>  create mode 100644 gas/testsuite/gas/riscv/zbb.s
>  create mode 100644 gas/testsuite/gas/riscv/zbc.d
>  create mode 100644 gas/testsuite/gas/riscv/zbc.s
>  create mode 100644 gas/testsuite/gas/riscv/zbs-64.d
>  create mode 100644 gas/testsuite/gas/riscv/zbs.d
>  create mode 100644 gas/testsuite/gas/riscv/zbs.s
>  create mode 100644 gas/testsuite/gas/riscv/zkr.d
>  create mode 100644 gas/testsuite/gas/riscv/zkr.s
>  create mode 100644 gas/testsuite/gas/riscv/zkt.d
> 
> 
> base-commit: 8e037eae6823caf5b9cb5b4feb3de838abb25956

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-25 14:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-23  7:49 [PATCH 0/2] RISC-V: Use only real extension names on testsuite Tsukasa OI
2022-09-23  7:49 ` [PATCH 1/2] RISC-V: Reorganize "K"-related subextension tests Tsukasa OI
2022-09-23  7:49 ` [PATCH 2/2] RISC-V: Reorganize "B"-related " Tsukasa OI
2022-10-25 14:54 ` [PATCH 0/2] RISC-V: Use only real extension names on testsuite Tsukasa OI

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).