]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Fix vendor intrinsic tests for disabled multilib configurations
authorKito Cheng <kito.cheng@sifive.com>
Wed, 10 Sep 2025 10:23:12 +0000 (18:23 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Mon, 15 Sep 2025 08:11:48 +0000 (16:11 +0800)
Add wrapper headers that prevent vendor vector headers from including
system stdint.h, ensuring tests work correctly when multilib is disabled.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/xandesvector/non-policy/non-overloaded/andes_vector.h: New file.
* gcc.target/riscv/rvv/xandesvector/non-policy/non-overloaded/nds_vfncvtbf16s.c
(#include): Use local andes_vector.h instead of system header.
* gcc.target/riscv/rvv/xandesvector/non-policy/non-overloaded/nds_vfwcvtsbf16.c
(#include): Likewise.
* gcc.target/riscv/rvv/xandesvector/non-policy/overloaded/andes_vector.h: New file.
* gcc.target/riscv/rvv/xandesvector/non-policy/overloaded/nds_vfncvtbf16s.c
(#include): Use local andes_vector.h instead of system header.
* gcc.target/riscv/rvv/xandesvector/non-policy/overloaded/nds_vfwcvtsbf16.c
(#include): Likewise.
* gcc.target/riscv/rvv/xandesvector/policy/non-overloaded/andes_vector.h: New file.
* gcc.target/riscv/rvv/xandesvector/policy/non-overloaded/nds_vfncvtbf16s.c
(#include): Use local andes_vector.h instead of system header.
* gcc.target/riscv/rvv/xandesvector/policy/non-overloaded/nds_vfwcvtsbf16.c
(#include): Likewise.
* gcc.target/riscv/rvv/xandesvector/policy/overloaded/andes_vector.h: New file.
* gcc.target/riscv/rvv/xandesvector/policy/overloaded/nds_vfncvtbf16s.c
(#include): Use local andes_vector.h instead of system header.
* gcc.target/riscv/rvv/xandesvector/policy/overloaded/nds_vfwcvtsbf16.c
(#include): Likewise.
* gcc.target/riscv/rvv/xsfvector/sifive_vector.h: New file.
* gcc.target/riscv/rvv/xtheadvector/riscv_th_vector.h: New file.
* gcc.target/riscv/rvv/xtheadvector/riscv_vector.h: New file.

15 files changed:
gcc/testsuite/gcc.target/riscv/rvv/xandesvector/non-policy/non-overloaded/andes_vector.h [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/xandesvector/non-policy/non-overloaded/nds_vfncvtbf16s.c
gcc/testsuite/gcc.target/riscv/rvv/xandesvector/non-policy/non-overloaded/nds_vfwcvtsbf16.c
gcc/testsuite/gcc.target/riscv/rvv/xandesvector/non-policy/overloaded/andes_vector.h [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/xandesvector/non-policy/overloaded/nds_vfncvtbf16s.c
gcc/testsuite/gcc.target/riscv/rvv/xandesvector/non-policy/overloaded/nds_vfwcvtsbf16.c
gcc/testsuite/gcc.target/riscv/rvv/xandesvector/policy/non-overloaded/andes_vector.h [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/xandesvector/policy/non-overloaded/nds_vfncvtbf16s.c
gcc/testsuite/gcc.target/riscv/rvv/xandesvector/policy/non-overloaded/nds_vfwcvtsbf16.c
gcc/testsuite/gcc.target/riscv/rvv/xandesvector/policy/overloaded/andes_vector.h [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/xandesvector/policy/overloaded/nds_vfncvtbf16s.c
gcc/testsuite/gcc.target/riscv/rvv/xandesvector/policy/overloaded/nds_vfwcvtsbf16.c
gcc/testsuite/gcc.target/riscv/rvv/xsfvector/sifive_vector.h [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/riscv_th_vector.h [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/riscv_vector.h [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.target/riscv/rvv/xandesvector/non-policy/non-overloaded/andes_vector.h b/gcc/testsuite/gcc.target/riscv/rvv/xandesvector/non-policy/non-overloaded/andes_vector.h
new file mode 100644 (file)
index 0000000..0d0a8ef
--- /dev/null
@@ -0,0 +1,11 @@
+/* Wrapper of andes_vector.h, prevent andes_vector.h including stdint.h from
+   C library, that might cause problem on testing RV32 related testcase when
+   we disable multilib.  */
+#ifndef _ANDES_VECTOR_WRAP_H
+
+#define _GCC_WRAP_STDINT_H
+#include "stdint-gcc.h"
+#include_next <andes_vector.h>
+#define _ANDES_VECTOR_WRAP_H
+
+#endif
index 8b03564d4ffc4f5df0d282d8cf17fc4c9fc6b7d5..5f15d7f235c81fff6d8a888ab8840289696343a2 100644 (file)
@@ -2,7 +2,7 @@
 /* { dg-options "-march=rv32gv_xandesvbfhcvt -mabi=ilp32 -O3 -fno-schedule-insns -fno-schedule-insns2" { target { rv32 } } } */
 /* { dg-options "-march=rv64gv_xandesvbfhcvt -mabi=lp64d -O3 -fno-schedule-insns -fno-schedule-insns2" { target { rv64 } } } */
 
-#include <andes_vector.h>
+#include "andes_vector.h"
 
 vbfloat16mf4_t test_nds_vfncvt_bf16_s_bf16mf4(vfloat32mf2_t vs2, size_t vl) {
     return __riscv_nds_vfncvt_bf16_s_bf16mf4(vs2, vl);
index b5aba62150b157ec44b64cfaf4235e3f2167941e..63b52978aa3e5baea2cfdbc9fa100c4545b35fb9 100644 (file)
@@ -2,7 +2,7 @@
 /* { dg-options "-march=rv32gv_xandesvbfhcvt -mabi=ilp32 -O3 -fno-schedule-insns -fno-schedule-insns2" { target { rv32 } } } */
 /* { dg-options "-march=rv64gv_xandesvbfhcvt -mabi=lp64d -O3 -fno-schedule-insns -fno-schedule-insns2" { target { rv64 } } } */
 
-#include <andes_vector.h>
+#include "andes_vector.h"
 
 vfloat32mf2_t test_nds_vfwcvt_s_bf16_f32mf2(vbfloat16mf4_t vs2, size_t vl) {
     return __riscv_nds_vfwcvt_s_bf16_f32mf2(vs2, vl);
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/xandesvector/non-policy/overloaded/andes_vector.h b/gcc/testsuite/gcc.target/riscv/rvv/xandesvector/non-policy/overloaded/andes_vector.h
new file mode 100644 (file)
index 0000000..0d0a8ef
--- /dev/null
@@ -0,0 +1,11 @@
+/* Wrapper of andes_vector.h, prevent andes_vector.h including stdint.h from
+   C library, that might cause problem on testing RV32 related testcase when
+   we disable multilib.  */
+#ifndef _ANDES_VECTOR_WRAP_H
+
+#define _GCC_WRAP_STDINT_H
+#include "stdint-gcc.h"
+#include_next <andes_vector.h>
+#define _ANDES_VECTOR_WRAP_H
+
+#endif
index 0409d6f5049fc12e677f9502294b54c86f25492d..5a6702809a23afd7f09a4880a6083216049c4539 100644 (file)
@@ -2,7 +2,7 @@
 /* { dg-options "-march=rv32gv_xandesvbfhcvt -mabi=ilp32 -O3 -fno-schedule-insns -fno-schedule-insns2" { target { rv32 } } } */
 /* { dg-options "-march=rv64gv_xandesvbfhcvt -mabi=lp64d -O3 -fno-schedule-insns -fno-schedule-insns2" { target { rv64 } } } */
 
-#include <andes_vector.h>
+#include "andes_vector.h"
 
 vbfloat16mf4_t test_nds_vfncvt_bf16_s_bf16mf4(vfloat32mf2_t vs2, size_t vl) {
     return __riscv_nds_vfncvt_bf16(vs2, vl);
index eefe6e257cd70c8dae18a451bcf854447c19fc4e..aca15295ec5616a8fc0a117ef697cfaa4e1bbafe 100644 (file)
@@ -2,7 +2,7 @@
 /* { dg-options "-march=rv32gv_xandesvbfhcvt -mabi=ilp32 -O3 -fno-schedule-insns -fno-schedule-insns2" { target { rv32 } } } */
 /* { dg-options "-march=rv64gv_xandesvbfhcvt -mabi=lp64d -O3 -fno-schedule-insns -fno-schedule-insns2" { target { rv64 } } } */
 
-#include <andes_vector.h>
+#include "andes_vector.h"
 
 vfloat32mf2_t test_nds_vfwcvt_s_bf16_f32mf2(vbfloat16mf4_t vs2, size_t vl) {
     return __riscv_nds_vfwcvt_s(vs2, vl);
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/xandesvector/policy/non-overloaded/andes_vector.h b/gcc/testsuite/gcc.target/riscv/rvv/xandesvector/policy/non-overloaded/andes_vector.h
new file mode 100644 (file)
index 0000000..289664c
--- /dev/null
@@ -0,0 +1,11 @@
+/* Wrapper of riscv_vector.h, prevent riscv_vector.h including stdint.h from
+   C library, that might cause problem on testing RV32 related testcase when
+   we disable multilib.  */
+#ifndef _ANDES_VECTOR_WRAP_H
+
+#define _GCC_WRAP_STDINT_H
+#include "stdint-gcc.h"
+#include_next <andes_vector.h>
+#define _ANDES_VECTOR_WRAP_H
+
+#endif
index 35061eaf9357fe20c2dfd5ff5113a10bdd445d5f..65a9260a3b9aa40a7e8600c39925f500dc550a47 100644 (file)
@@ -2,7 +2,7 @@
 /* { dg-options "-march=rv32gv_xandesvbfhcvt -mabi=ilp32 -O3 -fno-schedule-insns -fno-schedule-insns2" { target { rv32 } } } */
 /* { dg-options "-march=rv64gv_xandesvbfhcvt -mabi=lp64d -O3 -fno-schedule-insns -fno-schedule-insns2" { target { rv64 } } } */
 
-#include <andes_vector.h>
+#include "andes_vector.h"
 
 vbfloat16mf4_t test_nds_vfncvt_bf16_s_bf16mf4_tu(vbfloat16mf4_t vd, vfloat32mf2_t vs2, size_t vl) {
     return __riscv_nds_vfncvt_bf16_s_bf16mf4_tu(vd, vs2, vl);
index 142b1b47ea8dab52161f159e27e02903b75e8baa..b424d276e3432f779a870f133cba96a4d1d97274 100644 (file)
@@ -2,7 +2,7 @@
 /* { dg-options "-march=rv32gv_xandesvbfhcvt -mabi=ilp32 -O3 -fno-schedule-insns -fno-schedule-insns2" { target { rv32 } } } */
 /* { dg-options "-march=rv64gv_xandesvbfhcvt -mabi=lp64d -O3 -fno-schedule-insns -fno-schedule-insns2" { target { rv64 } } } */
 
-#include <andes_vector.h>
+#include "andes_vector.h"
 
 vfloat32mf2_t test_nds_vfwcvt_s_bf16_f32mf2_tu(vfloat32mf2_t vd, vbfloat16mf4_t vs2, size_t vl) {
     return __riscv_nds_vfwcvt_s_tu(vd, vs2, vl);
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/xandesvector/policy/overloaded/andes_vector.h b/gcc/testsuite/gcc.target/riscv/rvv/xandesvector/policy/overloaded/andes_vector.h
new file mode 100644 (file)
index 0000000..289664c
--- /dev/null
@@ -0,0 +1,11 @@
+/* Wrapper of riscv_vector.h, prevent riscv_vector.h including stdint.h from
+   C library, that might cause problem on testing RV32 related testcase when
+   we disable multilib.  */
+#ifndef _ANDES_VECTOR_WRAP_H
+
+#define _GCC_WRAP_STDINT_H
+#include "stdint-gcc.h"
+#include_next <andes_vector.h>
+#define _ANDES_VECTOR_WRAP_H
+
+#endif
index bce60f199266651a01d036c9a6b9d13ada2f6595..7343c6343d171278bf26fcbb1681a0e1770ea159 100644 (file)
@@ -2,7 +2,7 @@
 /* { dg-options "-march=rv32gv_xandesvbfhcvt -mabi=ilp32 -O3 -fno-schedule-insns -fno-schedule-insns2" { target { rv32 } } } */
 /* { dg-options "-march=rv64gv_xandesvbfhcvt -mabi=lp64d -O3 -fno-schedule-insns -fno-schedule-insns2" { target { rv64 } } } */
 
-#include <andes_vector.h>
+#include "andes_vector.h"
 
 vbfloat16mf4_t test_nds_vfncvt_bf16_s_bf16mf4_tu(vbfloat16mf4_t vd, vfloat32mf2_t vs2, size_t vl) {
     return __riscv_nds_vfncvt_bf16_tu(vd, vs2, vl);
index 142b1b47ea8dab52161f159e27e02903b75e8baa..b424d276e3432f779a870f133cba96a4d1d97274 100644 (file)
@@ -2,7 +2,7 @@
 /* { dg-options "-march=rv32gv_xandesvbfhcvt -mabi=ilp32 -O3 -fno-schedule-insns -fno-schedule-insns2" { target { rv32 } } } */
 /* { dg-options "-march=rv64gv_xandesvbfhcvt -mabi=lp64d -O3 -fno-schedule-insns -fno-schedule-insns2" { target { rv64 } } } */
 
-#include <andes_vector.h>
+#include "andes_vector.h"
 
 vfloat32mf2_t test_nds_vfwcvt_s_bf16_f32mf2_tu(vfloat32mf2_t vd, vbfloat16mf4_t vs2, size_t vl) {
     return __riscv_nds_vfwcvt_s_tu(vd, vs2, vl);
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/xsfvector/sifive_vector.h b/gcc/testsuite/gcc.target/riscv/rvv/xsfvector/sifive_vector.h
new file mode 100644 (file)
index 0000000..b94b24a
--- /dev/null
@@ -0,0 +1,11 @@
+/* Wrapper of sifive_vector.h, prevent sifive_vector.h including stdint.h from
+   C library, that might cause problem on testing RV32 related testcase when
+   we disable multilib.  */
+#ifndef _SIFIVE_VECTOR_WRAP_H
+
+#define _GCC_WRAP_STDINT_H
+#include "stdint-gcc.h"
+#include_next <riscv_vector.h>
+#define _SIFIVE_VECTOR_WRAP_H
+
+#endif
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/riscv_th_vector.h b/gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/riscv_th_vector.h
new file mode 100644 (file)
index 0000000..d824c61
--- /dev/null
@@ -0,0 +1,11 @@
+/* Wrapper of riscv_th_vector.h, prevent riscv_th_vector.h including stdint.h from
+   C library, that might cause problem on testing RV32 related testcase when
+   we disable multilib.  */
+#ifndef _RISCV_TH_VECTOR_WRAP_H
+
+#define _GCC_WRAP_STDINT_H
+#include "stdint-gcc.h"
+#include_next <riscv_th_vector.h>
+#define _RISCV_TH_VECTOR_WRAP_H
+
+#endif
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/riscv_vector.h b/gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/riscv_vector.h
new file mode 100644 (file)
index 0000000..fbb4858
--- /dev/null
@@ -0,0 +1,11 @@
+/* Wrapper of riscv_vector.h, prevent riscv_vector.h including stdint.h from
+   C library, that might cause problem on testing RV32 related testcase when
+   we disable multilib.  */
+#ifndef _RISCV_VECTOR_WRAP_H
+
+#define _GCC_WRAP_STDINT_H
+#include "stdint-gcc.h"
+#include_next <riscv_vector.h>
+#define _RISCV_VECTOR_WRAP_H
+
+#endif