public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/riscv/heads/gcc-13-with-riscv-opts)] RISC-V: Add TARGET_MIN_VLEN > 4096 check
@ 2023-07-25 18:32 Jeff Law
  0 siblings, 0 replies; only message in thread
From: Jeff Law @ 2023-07-25 18:32 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:f34657e0c69e7973bf9f48ba4d298e0011e835e4

commit f34657e0c69e7973bf9f48ba4d298e0011e835e4
Author: Juzhe-Zhong <juzhe.zhong@rivai.ai>
Date:   Mon Jul 17 22:20:02 2023 +0800

    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.
    
    (cherry picked from commit c1244ceed99bc37069baf164d008ff91f63d3115)

Diff:
---
 gcc/config/riscv/riscv.cc                                     | 8 ++++++++
 gcc/testsuite/gcc.target/riscv/rvv/base/zvl-unimplemented-1.c | 4 ++++
 gcc/testsuite/gcc.target/riscv/rvv/base/zvl-unimplemented-2.c | 4 ++++
 3 files changed, 16 insertions(+)

diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index ae3c034e76e..195f0019e06 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 00000000000..03f67035ca4
--- /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 00000000000..075112f2f81
--- /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" }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-07-25 18:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-25 18:32 [gcc(refs/vendors/riscv/heads/gcc-13-with-riscv-opts)] RISC-V: Add TARGET_MIN_VLEN > 4096 check Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).