public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: juzhe.zhong@rivai.ai
To: gcc-patches@gcc.gnu.org
Cc: kito.cheng@gmail.com, kito.cheng@sifive.com, palmer@dabbelt.com,
	palmer@rivosinc.com, jeffreyalaw@gmail.com, rdapp.gcc@gmail.com,
	Juzhe-Zhong <juzhe.zhong@rivai.ai>
Subject: [PATCH] RISC-V: Add comments of some functions
Date: Tue, 13 Jun 2023 10:26:11 +0800	[thread overview]
Message-ID: <20230613022611.2189297-1-juzhe.zhong@rivai.ai> (raw)

From: Juzhe-Zhong <juzhe.zhong@rivai.ai>

gcc/ChangeLog:

        * config/riscv/riscv-v.cc (rvv_builder::single_step_npatterns_p): Add comment.
        (shuffle_generic_patterns): Ditto.
        (expand_vec_perm_const_1): Ditto.

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

diff --git a/gcc/config/riscv/riscv-v.cc b/gcc/config/riscv/riscv-v.cc
index fb970344521..3ce2eb7f2ad 100644
--- a/gcc/config/riscv/riscv-v.cc
+++ b/gcc/config/riscv/riscv-v.cc
@@ -457,6 +457,9 @@ rvv_builder::single_step_npatterns_p () const
      { 2, 2, 2, 2, 4, 4, 4, 4, 8, 8, 8, 8, 16, 16, 16, 16, ... }
    E.g. NPATTERNS = 8:
      { 2, 2, 2, 2, 2, 2, 2, 2, 8, 8, 8, 8, 8, 8, 8, 8, ... }
+   We only check ele[0] ~ ele[NPATTERNS - 1] whether they are the same.
+   We don't need to check the elements[n] with n >= NPATTERNS since
+   they don't belong to the same pattern.
 */
 bool
 rvv_builder::npatterns_all_equal_p () const
@@ -2478,6 +2481,8 @@ shuffle_generic_patterns (struct expand_vec_perm_d *d)
   return true;
 }
 
+/* This function recognizes and supports different permutation patterns
+   and enable VLA SLP auto-vectorization.  */
 static bool
 expand_vec_perm_const_1 (struct expand_vec_perm_d *d)
 {
@@ -2509,6 +2514,8 @@ expand_vec_perm_const_1 (struct expand_vec_perm_d *d)
   return false;
 }
 
+/* This function implements TARGET_VECTORIZE_VEC_PERM_CONST by using RVV
+ * instructions.  */
 bool
 expand_vec_perm_const (machine_mode vmode, machine_mode op_mode, rtx target,
 		       rtx op0, rtx op1, const vec_perm_indices &sel)
-- 
2.36.3


             reply	other threads:[~2023-06-13  2:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-13  2:26 juzhe.zhong [this message]
2023-06-13 14:05 ` Jeff Law
2023-06-13 14:15   ` 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=20230613022611.2189297-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=palmer@dabbelt.com \
    --cc=palmer@rivosinc.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).