public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Juzhe-Zhong <juzhe.zhong@rivai.ai>
To: gcc-patches@gcc.gnu.org
Cc: kito.cheng@gmail.com, kito.cheng@sifive.com,
	jeffreyalaw@gmail.com, rdapp.gcc@gmail.com,
	Juzhe-Zhong <juzhe.zhong@rivai.ai>
Subject: [PATCH] RISC-V: Add dynamic LMUL compile option
Date: Fri,  1 Sep 2023 07:12:17 +0800	[thread overview]
Message-ID: <20230831231217.1853555-1-juzhe.zhong@rivai.ai> (raw)

We are going to support dynamic LMUL support.

gcc/ChangeLog:

	* config/riscv/riscv-opts.h (enum riscv_autovec_lmul_enum): Add dynamic enum.
	* config/riscv/riscv.opt: Add dynamic compile option.

---
 gcc/config/riscv/riscv-opts.h | 4 +++-
 gcc/config/riscv/riscv.opt    | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gcc/config/riscv/riscv-opts.h b/gcc/config/riscv/riscv-opts.h
index 5ed69abd214..79e0f12e388 100644
--- a/gcc/config/riscv/riscv-opts.h
+++ b/gcc/config/riscv/riscv-opts.h
@@ -79,7 +79,9 @@ enum riscv_autovec_lmul_enum {
   RVV_M1 = 1,
   RVV_M2 = 2,
   RVV_M4 = 4,
-  RVV_M8 = 8
+  RVV_M8 = 8,
+  /* For dynamic LMUL, we compare COST start with LMUL8.  */
+  RVV_DYNAMIC = RVV_M8
 };
 
 enum riscv_multilib_select_kind {
diff --git a/gcc/config/riscv/riscv.opt b/gcc/config/riscv/riscv.opt
index d2407c3c502..eca0dda4dd5 100644
--- a/gcc/config/riscv/riscv.opt
+++ b/gcc/config/riscv/riscv.opt
@@ -311,6 +311,9 @@ Enum(riscv_autovec_lmul) String(m4) Value(RVV_M4)
 EnumValue
 Enum(riscv_autovec_lmul) String(m8) Value(RVV_M8)
 
+EnumValue
+Enum(riscv_autovec_lmul) String(dynamic) Value(RVV_DYNAMIC)
+
 -param=riscv-autovec-lmul=
 Target RejectNegative Joined Enum(riscv_autovec_lmul) Var(riscv_autovec_lmul) Init(RVV_M1)
 -param=riscv-autovec-lmul=<string>	Set the RVV LMUL of auto-vectorization in the RISC-V port.
-- 
2.36.3


             reply	other threads:[~2023-08-31 23:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-31 23:12 Juzhe-Zhong [this message]
2023-09-01  9:57 ` Robin Dapp
2023-09-01 10:59   ` Li, Pan2

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230831231217.1853555-1-juzhe.zhong@rivai.ai \
    --to=juzhe.zhong@rivai.ai \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    --cc=kito.cheng@gmail.com \
    --cc=kito.cheng@sifive.com \
    --cc=rdapp.gcc@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).