public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kito Cheng <kito.cheng@gmail.com>
To: juzhe.zhong@rivai.ai
Cc: gcc-patches@gcc.gnu.org, palmer@dabbelt.com, rdapp.gcc@gmail.com,
	 jeffreyalaw@gmail.com
Subject: Re: [PATCH V2] RISC-V: Using merge approach to optimize repeating sequence in vec_init
Date: Fri, 12 May 2023 23:19:58 +0800	[thread overview]
Message-ID: <CA+yXCZDXtEzHLi0nY_zXNyjFNOhZEzLcT5nt8bp3cakxTJk6iA@mail.gmail.com> (raw)
In-Reply-To: <20230512145940.587528-1-juzhe.zhong@rivai.ai>

two minor comments:

> +  void add_ta_policy_operand (enum tail_policy vta)
> +  void add_ma_policy_operand (enum mask_policy vma)

You could just named as add_policy_operand since the arugment type is
already sufficient to distinguish.

> @@ -84,40 +92,52 @@ public:
>      add_input_operand (gen_int_mode (type, Pmode), Pmode);
>    }
>
> -  void set_dest_and_mask (rtx mask, rtx dest, machine_mode mask_mode)
> +  void set_dest_and_mask (rtx mask, rtx dest, machine_mode mask_mode,
> +                         bool scalar_move = false, bool merge_op = false)
>    {
>      dest_mode = GET_MODE (dest);
>      has_dest = true;
>
>      add_output_operand (dest, dest_mode);
>
> -    if (mask)
> -      add_input_operand (mask, GET_MODE (mask));
> -    else
> -      add_all_one_mask_operand (mask_mode);
> +    if (!merge_op)
> +      {
> +       if (mask)
> +         add_input_operand (mask, GET_MODE (mask));
> +       else
> +         {
> +           if (scalar_move)
> +             add_scalar_move_mask_operand (mask_mode);
> +           else
> +             add_all_one_mask_operand (mask_mode);
> +         }
> +      }

I would like to have set_dest_and_mask_merge_op to reduce the
complexity of set_dest_and_mask.
Accroding the code I got is:
- mask and merge_op are mutual exclusion.
- scalar_move will become meanless if merge_op is true.

So I think they mixed those togeter is not good idea.

  reply	other threads:[~2023-05-12 15:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-12 14:59 juzhe.zhong
2023-05-12 15:19 ` Kito Cheng [this message]
2023-05-12 15:48   ` 钟居哲

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=CA+yXCZDXtEzHLi0nY_zXNyjFNOhZEzLcT5nt8bp3cakxTJk6iA@mail.gmail.com \
    --to=kito.cheng@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    --cc=juzhe.zhong@rivai.ai \
    --cc=palmer@dabbelt.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).