[PATCH 1/3] RISC-V: Wider conflicts with the XTheadVector extension

Tsukasa OI research_trasio@irq.a4lg.com
Sun May 18 04:37:34 GMT 2025


From: Tsukasa OI <research_trasio@irq.a4lg.com>

T-Head/XuanTie's "XTheadVector" is based on a draft version of the now
standard vector extensions and it conflicts with not just the "V"
extension but all of its subsets.

This commit makes "XTheadVector" conflict with the "Zve32x" extension,
which is the smallest subset of the standard vector extensions.  Still,
a reference to "V" is preserved in the error message
as the documentation suggests:

> Therefore, the XTheadVector extension and the V extension are
> in conflict.

cf. <https://github.com/XUANTIE-RV/thead-extension-spec/blob/2.3.0/xtheadvector.adoc>

Note that, instructions in the "XTHeadZvamo" extension currently has
no conflicts with other extensions, even after addition of the "Zabha"
extension.

bfd/ChangeLog:

	* elfxx-riscv.c (riscv_parse_check_conflicts):
	Make "XTheadVector" conflict with not just "V" but its subsets.

gas/ChangeLog:

	* testsuite/gas/riscv/x-thead-vector-fail.d: Test a vector
	subset "Zve32x" to test failures.
	* testsuite/gas/riscv/x-thead-vector-fail.l: Reflect change
	in the error message.
---
 bfd/elfxx-riscv.c                             | 4 ++--
 gas/testsuite/gas/riscv/x-thead-vector-fail.d | 2 +-
 gas/testsuite/gas/riscv/x-thead-vector-fail.l | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
index 7b9285e19235..cdcbcd7a29b7 100644
--- a/bfd/elfxx-riscv.c
+++ b/bfd/elfxx-riscv.c
@@ -2155,10 +2155,10 @@ riscv_parse_check_conflicts (riscv_parse_subset_t *rps)
       no_conflict = false;
     }
   if (riscv_lookup_subset (rps->subset_list, "xtheadvector", &subset)
-      && riscv_lookup_subset (rps->subset_list, "v", &subset))
+      && riscv_lookup_subset (rps->subset_list, "zve32x", &subset))
     {
       rps->error_handler
-	(_("`xtheadvector' is conflict with the `v' extension"));
+	(_("`xtheadvector' is conflict with the `v/zve32x' extension"));
       no_conflict = false;
     }
   if (riscv_lookup_subset (rps->subset_list, "zclsd", &subset)
diff --git a/gas/testsuite/gas/riscv/x-thead-vector-fail.d b/gas/testsuite/gas/riscv/x-thead-vector-fail.d
index ac99c3f53985..35231d983ff9 100644
--- a/gas/testsuite/gas/riscv/x-thead-vector-fail.d
+++ b/gas/testsuite/gas/riscv/x-thead-vector-fail.d
@@ -1,3 +1,3 @@
-#as: -march=rv64gcv_xtheadvector
+#as: -march=rv64gc_zve32x_xtheadvector
 #source: x-thead-vector.s
 #error_output: x-thead-vector-fail.l
diff --git a/gas/testsuite/gas/riscv/x-thead-vector-fail.l b/gas/testsuite/gas/riscv/x-thead-vector-fail.l
index 7dd88e317ce4..6b4d82810e3f 100644
--- a/gas/testsuite/gas/riscv/x-thead-vector-fail.l
+++ b/gas/testsuite/gas/riscv/x-thead-vector-fail.l
@@ -1,2 +1,2 @@
 Assembler messages:
-Error: `xtheadvector' is conflict with the `v' extension
\ No newline at end of file
+Error: `xtheadvector' is conflict with the `v/zve32x' extension
-- 
2.43.0



More information about the Binutils mailing list