public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: Add TARGET_MIN_VLEN > 4096 check
@ 2023-07-17  6:04 Juzhe-Zhong
  2023-07-17  6:12 ` Kito Cheng
  0 siblings, 1 reply; 2+ messages in thread
From: Juzhe-Zhong @ 2023-07-17  6:04 UTC (permalink / raw)
  To: gcc-patches
  Cc: kito.cheng, kito.cheng, palmer, palmer, jeffreyalaw, rdapp.gcc,
	Juzhe-Zhong

gcc/ChangeLog:

        * config/riscv/riscv.cc (riscv_option_override): Report ERROR for TARGET_MIN_VLEN > 4096

---
 gcc/config/riscv/riscv.cc | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index 6ed735d6983..ce523eea9ba 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)
+    error (
+      "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 ();
 }
-- 
2.36.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] RISC-V: Add TARGET_MIN_VLEN > 4096 check
  2023-07-17  6:04 [PATCH] RISC-V: Add TARGET_MIN_VLEN > 4096 check Juzhe-Zhong
@ 2023-07-17  6:12 ` Kito Cheng
  0 siblings, 0 replies; 2+ messages in thread
From: Kito Cheng @ 2023-07-17  6:12 UTC (permalink / raw)
  To: Juzhe-Zhong
  Cc: gcc-patches, kito.cheng, palmer, palmer, jeffreyalaw, rdapp.gcc

On Mon, Jul 17, 2023 at 2:05 PM Juzhe-Zhong <juzhe.zhong@rivai.ai> wrote:
>
> gcc/ChangeLog:
>
>         * config/riscv/riscv.cc (riscv_option_override): Report ERROR for TARGET_MIN_VLEN > 4096
>
> ---
>  gcc/config/riscv/riscv.cc | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
> index 6ed735d6983..ce523eea9ba 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)
> +    error (

For this scenario, use sorry rather than error,
and I assume this is only a problem for
-param=riscv-autovec-preference=fixed-vlmax?


> +      "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 ();
>  }
> --
> 2.36.1
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-17  6:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-17  6:04 [PATCH] RISC-V: Add TARGET_MIN_VLEN > 4096 check Juzhe-Zhong
2023-07-17  6:12 ` Kito Cheng

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).