From: Robin Dapp <rdapp.gcc@gmail.com>
To: Lehua Ding <lehua.ding@rivai.ai>, gcc-patches@gcc.gnu.org
Cc: rdapp.gcc@gmail.com, juzhe.zhong@rivai.ai, kito.cheng@gmail.com,
palmer@rivosinc.com, jeffreyalaw@gmail.com
Subject: Re: [PATCH] RISC-V: Adjusting the comments of the emit_vlmax_insn/emit_vlmax_insn_lra/emit_nonvlmax_insn functions
Date: Thu, 21 Sep 2023 11:07:08 +0200 [thread overview]
Message-ID: <346cc997-ca97-5cf9-d20c-e50206f6eefd@gmail.com> (raw)
In-Reply-To: <20230921071118.3321383-1-lehua.ding@rivai.ai>
Hi Lehua,
I once had different comments for those but either I never pushed them
or they got buried in the process of refactoring. The explanatory
comment explaining vlmax is also in "nowhere land" below autovec_use_vlmax_p.
(it says vsetvli instead of vsetvl as well...) It would be useful
to move it to above the function comments you touch.
> +/* Emit RVV insn which vl is the number of units of the vector mode.
> + This function can only be used before LRA pass or for VLS_AVL_IMM modes. */
Emit an RVV insn with a vector length that equals the number of units of
the vector mode. For VLA modes this corresponds to VLMAX.
Unless the vector length can be encoded in the vsetivl[i] instruction this
function must only be used as long as we can create pseudo registers.
This is because it will set a pseudo register to VLMAX using vsetvl and
use this as definition for the vector length.
Besides, we could add a const_vlmax_p () || can_create_pseudo_p assert here?
> +/* Like emit_vlmax_insn but can be only used after LRA pass that can't create
> + pseudo register. */
Like emit_vlmax_insn but must only be used when we cannot create pseudo
registers anymore. This function, however, takes a predefined vector
length from the value in VL.
> +/* Emit RVV insn which vl is the VL argument. */
> +emit_nonvlmax_insn (unsigned icode, unsigned insn_flags, rtx *ops, rtx vl)
I think I renamed this to emit_len_insn or something before but Juzhe didn't
like it ;)
How about something like:
Emit an RVV insn with a predefined vector length. Contrary to emit_vlmax_insn
the instruction's vector length is not deduced from its mode but taken from
the value in VL.
Regards
Robin
next prev parent reply other threads:[~2023-09-21 9:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-21 7:11 Lehua Ding
2023-09-21 9:07 ` Robin Dapp [this message]
2023-09-21 9:51 ` Lehua Ding
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=346cc997-ca97-5cf9-d20c-e50206f6eefd@gmail.com \
--to=rdapp.gcc@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jeffreyalaw@gmail.com \
--cc=juzhe.zhong@rivai.ai \
--cc=kito.cheng@gmail.com \
--cc=lehua.ding@rivai.ai \
--cc=palmer@rivosinc.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).