diff --git a/gas/testsuite/gas/riscv/zicbo-mz-ext-fail.d b/gas/testsuite/gas/riscv/zicbo-mz-ext-fail.d
new file mode 100644
index 00000000000..e84233b09a1
--- /dev/null
+++ b/gas/testsuite/gas/riscv/zicbo-mz-ext-fail.d
@@ -0,0 +1,2 @@
+#as: -march=rv32i_zicbom_zicboz
+#error_output: zicbo-mz-ext-fail.l
diff --git a/gas/testsuite/gas/riscv/zicbo-mz-ext-fail.l b/gas/testsuite/gas/riscv/zicbo-mz-ext-fail.l
new file mode 100644
index 00000000000..a0bd7096f25
--- /dev/null
+++ b/gas/testsuite/gas/riscv/zicbo-mz-ext-fail.l
@@ -0,0 +1,11 @@
+.*: Assembler messages:
+.*: Error: illegal operands `cbo\.clean 1\(x1\)'
+.*: Error: illegal operands `cbo\.clean x30'
+.*: Error: illegal operands `cbo\.flush \(0\+1\)\(x1\)'
+.*: Error: illegal operands `cbo\.flush x30'
+.*: Error: illegal operands `cbo\.inval 3\*2\+5\(x1\)'
+.*: Error: illegal operands `cbo\.inval x30'
+.*: Error: illegal operands `cbo\.zero x1'
+.*: Error: illegal operands `cbo\.zero 1\(x30\)'
+.*: Error: illegal operands `cbo\.zero 3\+5\(x1\)'
+.*: Error: illegal operands `cbo\.zero \(2\*4\)\(x30\)'
diff --git a/gas/testsuite/gas/riscv/zicbom-fail.s b/gas/testsuite/gas/riscv/zicbo-mz-ext-fail.s
similarity index 61%
rename from gas/testsuite/gas/riscv/zicbom-fail.s
rename to gas/testsuite/gas/riscv/zicbo-mz-ext-fail.s
index 5fa22749b3a..447e9c37de7 100644
--- a/gas/testsuite/gas/riscv/zicbom-fail.s
+++ b/gas/testsuite/gas/riscv/zicbo-mz-ext-fail.s
@@ -5,3 +5,7 @@ target:
 	cbo.flush	x30
 	cbo.inval	3*2+5(x1)
 	cbo.inval	x30
+	cbo.zero	x1
+	cbo.zero	1(x30)
+	cbo.zero	3+5(x1)
+	cbo.zero	(2*4)(x30)
diff --git a/gas/testsuite/gas/riscv/zicbo-mz-ext-noarch.d b/gas/testsuite/gas/riscv/zicbo-mz-ext-noarch.d
new file mode 100644
index 00000000000..33db96dd471
--- /dev/null
+++ b/gas/testsuite/gas/riscv/zicbo-mz-ext-noarch.d
@@ -0,0 +1,3 @@
+#as: -march=rv32i -I$srcdir/$subdir -defsym NOARCH=1
+#source: zicbo-mz-ext.s
+#error_output: zicbo-mz-ext-noarch.l
diff --git a/gas/testsuite/gas/riscv/zicbo-mz-ext-noarch.l b/gas/testsuite/gas/riscv/zicbo-mz-ext-noarch.l
new file mode 100644
index 00000000000..6cf1e4821a2
--- /dev/null
+++ b/gas/testsuite/gas/riscv/zicbo-mz-ext-noarch.l
@@ -0,0 +1,11 @@
+.*: Assembler messages:
+.*: Error: unrecognized opcode `cbo\.clean \(x1\)', extension `zicbom' required
+.*: Error: unrecognized opcode `cbo\.clean 0\(x30\)', extension `zicbom' required
+.*: Error: unrecognized opcode `cbo\.flush \(x1\)', extension `zicbom' required
+.*: Error: unrecognized opcode `cbo\.flush \(2-2\)\(x30\)', extension `zicbom' required
+.*: Error: unrecognized opcode `cbo\.inval \(x1\)', extension `zicbom' required
+.*: Error: unrecognized opcode `cbo\.inval 3\*4-12\(x30\)', extension `zicbom' required
+.*: Error: unrecognized opcode `cbo\.zero 0\(x1\)', extension `zicboz' required
+.*: Error: unrecognized opcode `cbo\.zero \(x30\)', extension `zicboz' required
+.*: Error: unrecognized opcode `cbo\.zero 2-2\(x1\)', extension `zicboz' required
+.*: Error: unrecognized opcode `cbo\.zero \(3\*5-15\)\(x30\)', extension `zicboz' required
diff --git a/gas/testsuite/gas/riscv/zicbom.d b/gas/testsuite/gas/riscv/zicbo-mz-ext.d
similarity index 60%
rename from gas/testsuite/gas/riscv/zicbom.d
rename to gas/testsuite/gas/riscv/zicbo-mz-ext.d
index edd8a7079f4..9daa1cc4a93 100644
--- a/gas/testsuite/gas/riscv/zicbom.d
+++ b/gas/testsuite/gas/riscv/zicbo-mz-ext.d
@@ -1,6 +1,5 @@
-#as: -march=rv64g_zicbom
-#source: zicbom.s
-#objdump: -dr
+#as: -march=rv32i -I$srcdir/$subdir
+#objdump: -d
 
 .*:[ 	]+file format .*
 
@@ -13,3 +12,7 @@ Disassembly of section .text:
 [ 	]+[0-9a-f]+:[ 	]+002f200f[ 	]+cbo\.flush[ 	]+\(t5\)
 [ 	]+[0-9a-f]+:[ 	]+0000a00f[ 	]+cbo\.inval[ 	]+\(ra\)
 [ 	]+[0-9a-f]+:[ 	]+000f200f[ 	]+cbo\.inval[ 	]+\(t5\)
+[ 	]+[0-9a-f]+:[ 	]+0040a00f[ 	]+cbo\.zero[ 	]+\(ra\)
+[ 	]+[0-9a-f]+:[ 	]+004f200f[ 	]+cbo\.zero[ 	]+\(t5\)
+[ 	]+[0-9a-f]+:[ 	]+0040a00f[ 	]+cbo\.zero[ 	]+\(ra\)
+[ 	]+[0-9a-f]+:[ 	]+004f200f[ 	]+cbo\.zero[ 	]+\(t5\)
diff --git a/gas/testsuite/gas/riscv/zicbo-mz-ext.s b/gas/testsuite/gas/riscv/zicbo-mz-ext.s
new file mode 100644
index 00000000000..af997377903
--- /dev/null
+++ b/gas/testsuite/gas/riscv/zicbo-mz-ext.s
@@ -0,0 +1,16 @@
+.include "testutils.inc"
+target:
+	SET_ARCH_START	+zicbom
+	cbo.clean	(x1)
+	cbo.clean	0(x30)
+	cbo.flush	(x1)
+	cbo.flush	(2-2)(x30)
+	cbo.inval	(x1)
+	cbo.inval	3*4-12(x30)
+	SET_ARCH_END
+	SET_ARCH_START	+zicboz
+	cbo.zero	0(x1)
+	cbo.zero	(x30)
+	cbo.zero	2-2(x1)
+	cbo.zero	(3*5-15)(x30)
+	SET_ARCH_END
diff --git a/gas/testsuite/gas/riscv/zicbom-fail.d b/gas/testsuite/gas/riscv/zicbom-fail.d
deleted file mode 100644
index a6a61dfd37e..00000000000
--- a/gas/testsuite/gas/riscv/zicbom-fail.d
+++ /dev/null
@@ -1,3 +0,0 @@
-#as: -march=rv64g_zicbom
-#source: zicbom-fail.s
-#error_output: zicbom-fail.l
diff --git a/gas/testsuite/gas/riscv/zicbom-fail.l b/gas/testsuite/gas/riscv/zicbom-fail.l
deleted file mode 100644
index 2cf76356d2b..00000000000
--- a/gas/testsuite/gas/riscv/zicbom-fail.l
+++ /dev/null
@@ -1,7 +0,0 @@
-.*: Assembler messages:
-.*: Error: illegal operands `cbo.clean 1\(x1\)'
-.*: Error: illegal operands `cbo.clean x30'
-.*: Error: illegal operands `cbo.flush \(0\+1\)\(x1\)'
-.*: Error: illegal operands `cbo.flush x30'
-.*: Error: illegal operands `cbo.inval 3\*2\+5\(x1\)'
-.*: Error: illegal operands `cbo.inval x30'
diff --git a/gas/testsuite/gas/riscv/zicbom.s b/gas/testsuite/gas/riscv/zicbom.s
deleted file mode 100644
index 6a306b931ed..00000000000
--- a/gas/testsuite/gas/riscv/zicbom.s
+++ /dev/null
@@ -1,7 +0,0 @@
-target:
-	cbo.clean	(x1)
-	cbo.clean	0(x30)
-	cbo.flush	(x1)
-	cbo.flush	(2-2)(x30)
-	cbo.inval	(x1)
-	cbo.inval	3*4-12(x30)
diff --git a/gas/testsuite/gas/riscv/zicboz-fail.d b/gas/testsuite/gas/riscv/zicboz-fail.d
deleted file mode 100644
index 74cfd2fc911..00000000000
--- a/gas/testsuite/gas/riscv/zicboz-fail.d
+++ /dev/null
@@ -1,3 +0,0 @@
-#as: -march=rv64g_zicboz
-#source: zicboz-fail.s
-#error_output: zicboz-fail.l
diff --git a/gas/testsuite/gas/riscv/zicboz-fail.l b/gas/testsuite/gas/riscv/zicboz-fail.l
deleted file mode 100644
index ad8dcf54e00..00000000000
--- a/gas/testsuite/gas/riscv/zicboz-fail.l
+++ /dev/null
@@ -1,5 +0,0 @@
-.*: Assembler messages:
-.*: Error: illegal operands `cbo.zero x1'
-.*: Error: illegal operands `cbo.zero 1\(x30\)'
-.*: Error: illegal operands `cbo.zero 3\+5\(x1\)'
-.*: Error: illegal operands `cbo.zero \(2\*4\)\(x30\)'
diff --git a/gas/testsuite/gas/riscv/zicboz-fail.s b/gas/testsuite/gas/riscv/zicboz-fail.s
deleted file mode 100644
index 0856ea85ab1..00000000000
--- a/gas/testsuite/gas/riscv/zicboz-fail.s
+++ /dev/null
@@ -1,5 +0,0 @@
-target:
-	cbo.zero	x1
-	cbo.zero	1(x30)
-	cbo.zero	3+5(x1)
-	cbo.zero	(2*4)(x30)
diff --git a/gas/testsuite/gas/riscv/zicboz.d b/gas/testsuite/gas/riscv/zicboz.d
deleted file mode 100644
index e04ab3491db..00000000000
--- a/gas/testsuite/gas/riscv/zicboz.d
+++ /dev/null
@@ -1,13 +0,0 @@
-#as: -march=rv64g_zicboz
-#source: zicboz.s
-#objdump: -dr
-
-.*:[ 	]+file format .*
-
-Disassembly of section .text:
-
-0+000 <target>:
-[ 	]+[0-9a-f]+:[ 	]+0040a00f[ 	]+cbo\.zero[ 	]+\(ra\)
-[ 	]+[0-9a-f]+:[ 	]+004f200f[ 	]+cbo\.zero[ 	]+\(t5\)
-[ 	]+[0-9a-f]+:[ 	]+0040a00f[ 	]+cbo\.zero[ 	]+\(ra\)
-[ 	]+[0-9a-f]+:[ 	]+004f200f[ 	]+cbo\.zero[ 	]+\(t5\)
diff --git a/gas/testsuite/gas/riscv/zicboz.s b/gas/testsuite/gas/riscv/zicboz.s
deleted file mode 100644
index 3830362c376..00000000000
--- a/gas/testsuite/gas/riscv/zicboz.s
+++ /dev/null
@@ -1,5 +0,0 @@
-target:
-	cbo.zero	0(x1)
-	cbo.zero	(x30)
-	cbo.zero	2-2(x1)
-	cbo.zero	(3*5-15)(x30)
