[PATCH 2/2] RISC-V: Reorganize "B"-related subextension tests

Tsukasa OI research_trasio@irq.a4lg.com
Fri Sep 23 07:49:17 GMT 2022


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[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 	]+bseti[ 	]+a0,a1,0x3f
-[ 	]+[0-9a-f]+:[ 	]+6bf59513[ 	]+binvi[ 	]+a0,a1,0x3f
-[ 	]+[0-9a-f]+:[ 	]+4bf5d513[ 	]+bexti[ 	]+a0,a1,0x3f
-[ 	]+[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
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[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 	]+clmulr[ 	]+a0,a1,a2
-[ 	]+[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/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 rv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[ 	]+6015151b[ 	]+ctzw[ 	]+a0,a0
+[ 	]+[0-9a-f]+:[ 	]+6025151b[ 	]+cpopw[ 	]+a0,a0
+[ 	]+[0-9a-f]+:[ 	]+60c5953b[ 	]+rolw[ 	]+a0,a1,a2
+[ 	]+[0-9a-f]+:[ 	]+60c5d53b[ 	]+rorw[ 	]+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[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/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



More information about the Binutils mailing list