diff options
author | Juzhe-Zhong <juzhe.zhong@rivai.ai> | 2023-07-17 22:20:02 +0800 |
---|---|---|
committer | Pan Li <pan2.li@intel.com> | 2023-07-17 22:27:43 +0800 |
commit | c1244ceed99bc37069baf164d008ff91f63d3115 (patch) | |
tree | c3cc2e5bc39bb4b3e114f5617f6c5ad8a67d4afc /gcc | |
parent | 89d0f082b3c95f68d116d4480126e3ab7fb7f36b (diff) | |
download | gcc-c1244ceed99bc37069baf164d008ff91f63d3115.zip gcc-c1244ceed99bc37069baf164d008ff91f63d3115.tar.gz gcc-c1244ceed99bc37069baf164d008ff91f63d3115.tar.bz2 |
RISC-V: Add TARGET_MIN_VLEN > 4096 check
gcc/ChangeLog:
* config/riscv/riscv.cc (riscv_option_override): Add sorry check.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/base/zvl-unimplemented-1.c: New test.
* gcc.target/riscv/rvv/base/zvl-unimplemented-2.c: New test.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/riscv/riscv.cc | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/riscv/rvv/base/zvl-unimplemented-1.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/riscv/rvv/base/zvl-unimplemented-2.c | 4 |
3 files changed, 16 insertions, 0 deletions
diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index ae3c034..195f001 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -6672,6 +6672,14 @@ riscv_option_override (void) riscv_stack_protector_guard_offset = offs; } + /* FIXME: We don't allow TARGET_MIN_VLEN > 4096 since the datatypes of + both GET_MODE_SIZE and GET_MODE_BITSIZE are poly_uint16. + + We can only allow TARGET_MIN_VLEN * 8 (LMUL) < 65535. */ + if (TARGET_MIN_VLEN > 4096) + sorry ( + "Current RISC-V GCC can not support VLEN > 4096bit for 'V' Extension"); + /* Convert -march to a chunks count. */ riscv_vector_chunks = riscv_convert_vector_bits (); } diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/zvl-unimplemented-1.c b/gcc/testsuite/gcc.target/riscv/rvv/base/zvl-unimplemented-1.c new file mode 100644 index 0000000..03f6703 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/zvl-unimplemented-1.c @@ -0,0 +1,4 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=rv64gcv_zvl8192b -mabi=lp64d --param riscv-autovec-preference=fixed-vlmax" } */ + +void foo () {} // { dg-excess-errors "sorry, unimplemented: Current RISC-V GCC can not support VLEN > 4096bit for 'V' Extension" } diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/zvl-unimplemented-2.c b/gcc/testsuite/gcc.target/riscv/rvv/base/zvl-unimplemented-2.c new file mode 100644 index 0000000..075112f --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/zvl-unimplemented-2.c @@ -0,0 +1,4 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=rv64gcv_zvl8192b -mabi=lp64d --param riscv-autovec-preference=scalable" } */ + +void foo () {} // { dg-excess-errors "sorry, unimplemented: Current RISC-V GCC can not support VLEN > 4096bit for 'V' Extension" } |