https://gcc.gnu.org/g:ebca3fd0efc881ad033a7a8da6e7f254edfca26c
commit r17-2534-gebca3fd0efc881ad033a7a8da6e7f254edfca26c Author: Pan Li <[email protected]> Date: Sun Jul 19 17:25:21 2026 +0800 RISC-V: Add test cases for vfwcvt.f.f.v reg overlap Add test cases for vfwcvt.f.f.v register group overlap, please note it is not overlap as much as possible. Signed-off-by: Pan Li <[email protected]> gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-m1.c: New test. * gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-m2.c: New test. * gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-m4.c: New test. * gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-mf2.c: New test. * gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-mf4.c: New test. * gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f32-m1.c: New test. * gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f32-m2.c: New test. * gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f32-m4.c: New test. * gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f32-mf2.c: New test. Signed-off-by: Pan Li <[email protected]> Diff: --- .../rvv/autovec/group_overlap/vfwcvt_f-f16-m1.c | 17 ++++++++++++ .../rvv/autovec/group_overlap/vfwcvt_f-f16-m2.c | 17 ++++++++++++ .../rvv/autovec/group_overlap/vfwcvt_f-f16-m4.c | 17 ++++++++++++ .../rvv/autovec/group_overlap/vfwcvt_f-f16-mf2.c | 31 ++++++++++++++++++++++ .../rvv/autovec/group_overlap/vfwcvt_f-f16-mf4.c | 31 ++++++++++++++++++++++ .../rvv/autovec/group_overlap/vfwcvt_f-f32-m1.c | 17 ++++++++++++ .../rvv/autovec/group_overlap/vfwcvt_f-f32-m2.c | 17 ++++++++++++ .../rvv/autovec/group_overlap/vfwcvt_f-f32-m4.c | 17 ++++++++++++ .../rvv/autovec/group_overlap/vfwcvt_f-f32-mf2.c | 31 ++++++++++++++++++++++ 9 files changed, 195 insertions(+) diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-m1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-m1.c new file mode 100644 index 000000000000..86409853074e --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-m1.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvfh -mabi=lp64d" } */ + +#include "group_overlap.h" + +DEF_GROUP_OVERLAP_UNARY_0( + __riscv_vsetvlmax_e16m1, + vfloat16m1_t, + vfloat32m2_t, + __riscv_vle16_v_f16m1, + __riscv_vfwcvt_f_f_v_f32m2, + __riscv_vse32_v_f32m2, + vfwcvt_f, + LOOP_UNARY_BODY_X16) + +/* { dg-final { scan-assembler-times {vfwcvt\.f\.f\.v\s+v0,v1([^0-9]|$)} 1 } } */ +/* { dg-final { scan-assembler-times {vfwcvt\.f\.f\.v\s+v2,v3([^0-9]|$)} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-m2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-m2.c new file mode 100644 index 000000000000..2ba4a0fe8ff4 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-m2.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvfh -mabi=lp64d" } */ + +#include "group_overlap.h" + +DEF_GROUP_OVERLAP_UNARY_0( + __riscv_vsetvlmax_e16m2, + vfloat16m2_t, + vfloat32m4_t, + __riscv_vle16_v_f16m2, + __riscv_vfwcvt_f_f_v_f32m4, + __riscv_vse32_v_f32m4, + vfwcvt_f, + LOOP_UNARY_BODY_X8) + +/* { dg-final { scan-assembler-times {vfwcvt\.f\.f\.v\s+v0,v2([^0-9]|$)} 1 } } */ +/* { dg-final { scan-assembler-times {vfwcvt\.f\.f\.v\s+v4,v6} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-m4.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-m4.c new file mode 100644 index 000000000000..b2a89c0e6c9f --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-m4.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvfh -mabi=lp64d" } */ + +#include "group_overlap.h" + +DEF_GROUP_OVERLAP_UNARY_0( + __riscv_vsetvlmax_e16m4, + vfloat16m4_t, + vfloat32m8_t, + __riscv_vle16_v_f16m4, + __riscv_vfwcvt_f_f_v_f32m8, + __riscv_vse32_v_f32m8, + vfwcvt_f, + LOOP_UNARY_BODY_X4) + +/* { dg-final { scan-assembler-times {vfwcvt\.f\.f\.v\s+v0,v4} 1 } } */ +/* { dg-final { scan-assembler-times {vfwcvt\.f\.f\.v\s+v8,v12} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-mf2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-mf2.c new file mode 100644 index 000000000000..ba915cba35ed --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-mf2.c @@ -0,0 +1,31 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvfh -mabi=lp64d" } */ + +#include "group_overlap.h" + +DEF_GROUP_OVERLAP_UNARY_0( + __riscv_vsetvlmax_e16m1, + vfloat16mf2_t, + vfloat32m1_t, + __riscv_vle16_v_f16mf2, + __riscv_vfwcvt_f_f_v_f32m1, + __riscv_vse32_v_f32m1, + vfwcvt_f, + LOOP_UNARY_BODY_X16) + +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v0,v1([^0-9]|$)} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v2,v3([^0-9]|$)} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v4,v5} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v6,v7} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v8,v9} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v10,v11} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v12,v13} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v14,v15} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v16,v17} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v18,v19} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v20,v21} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v22,v23} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v24,v25} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v26,v27} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v28,v29} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v30,v31} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-mf4.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-mf4.c new file mode 100644 index 000000000000..608e23e4612f --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-mf4.c @@ -0,0 +1,31 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv_zvfh -mabi=lp64d" } */ + +#include "group_overlap.h" + +DEF_GROUP_OVERLAP_UNARY_0( + __riscv_vsetvlmax_e16m1, + vfloat16mf4_t, + vfloat32mf2_t, + __riscv_vle16_v_f16mf4, + __riscv_vfwcvt_f_f_v_f32mf2, + __riscv_vse32_v_f32mf2, + vfwcvt_f, + LOOP_UNARY_BODY_X16) + +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v0,v1([^0-9]|$)} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v2,v3([^0-9]|$)} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v4,v5} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v6,v7} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v8,v9} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v10,v11} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v12,v13} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v14,v15} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v16,v17} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v18,v19} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v20,v21} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v22,v23} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v24,v25} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v26,v27} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v28,v29} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v30,v31} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f32-m1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f32-m1.c new file mode 100644 index 000000000000..4a899d985afc --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f32-m1.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv -mabi=lp64d" } */ + +#include "group_overlap.h" + +DEF_GROUP_OVERLAP_UNARY_0( + __riscv_vsetvlmax_e32m1, + vfloat32m1_t, + vfloat64m2_t, + __riscv_vle32_v_f32m1, + __riscv_vfwcvt_f_f_v_f64m2, + __riscv_vse64_v_f64m2, + vfwcvt_f, + LOOP_UNARY_BODY_X16) + +/* { dg-final { scan-assembler-times {vfwcvt\.f\.f\.v\s+v0,v1([^0-9]|$)} 1 } } */ +/* { dg-final { scan-assembler-times {vfwcvt\.f\.f\.v\s+v2,v3([^0-9]|$)} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f32-m2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f32-m2.c new file mode 100644 index 000000000000..ce2d93dfc38d --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f32-m2.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv -mabi=lp64d" } */ + +#include "group_overlap.h" + +DEF_GROUP_OVERLAP_UNARY_0( + __riscv_vsetvlmax_e32m2, + vfloat32m2_t, + vfloat64m4_t, + __riscv_vle32_v_f32m2, + __riscv_vfwcvt_f_f_v_f64m4, + __riscv_vse64_v_f64m4, + vfwcvt_f, + LOOP_UNARY_BODY_X8) + +/* { dg-final { scan-assembler-times {vfwcvt\.f\.f\.v\s+v0,v2([^0-9]|$)} 1 } } */ +/* { dg-final { scan-assembler-times {vfwcvt\.f\.f\.v\s+v4,v6} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f32-m4.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f32-m4.c new file mode 100644 index 000000000000..0044eb445e90 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f32-m4.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv -mabi=lp64d" } */ + +#include "group_overlap.h" + +DEF_GROUP_OVERLAP_UNARY_0( + __riscv_vsetvlmax_e32m4, + vfloat32m4_t, + vfloat64m8_t, + __riscv_vle32_v_f32m4, + __riscv_vfwcvt_f_f_v_f64m8, + __riscv_vse64_v_f64m8, + vfwcvt_f, + LOOP_UNARY_BODY_X4) + +/* { dg-final { scan-assembler-times {vfwcvt\.f\.f\.v\s+v0,v4} 1 } } */ +/* { dg-final { scan-assembler-times {vfwcvt\.f\.f\.v\s+v8,v12} 1 } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f32-mf2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f32-mf2.c new file mode 100644 index 000000000000..5d0be3b79571 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f32-mf2.c @@ -0,0 +1,31 @@ +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv -mabi=lp64d" } */ + +#include "group_overlap.h" + +DEF_GROUP_OVERLAP_UNARY_0( + __riscv_vsetvlmax_e32m1, + vfloat32mf2_t, + vfloat64m1_t, + __riscv_vle32_v_f32mf2, + __riscv_vfwcvt_f_f_v_f64m1, + __riscv_vse64_v_f64m1, + vfwcvt_f, + LOOP_UNARY_BODY_X16) + +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v0,v1([^0-9]|$)} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v2,v3([^0-9]|$)} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v4,v5} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v6,v7} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v8,v9} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v10,v11} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v12,v13} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v14,v15} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v16,v17} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v18,v19} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v20,v21} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v22,v23} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v24,v25} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v26,v27} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v28,v29} } } */ +/* { dg-final { scan-assembler-not {vfwcvt\.f\.f\.v\s+v30,v31} } } */
