public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kito Cheng <kito.cheng@sifive.com>
To: "Li, Pan2" <pan2.li@intel.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	"juzhe.zhong@rivai.ai" <juzhe.zhong@rivai.ai>,
	 "Wang, Yanzhang" <yanzhang.wang@intel.com>
Subject: Re: [PATCH] RISC-V: Allow RVV VMS{Compare}(V1, V1) simplify to VMCLR
Date: Fri, 28 Apr 2023 14:35:10 +0800	[thread overview]
Message-ID: <CALLt3Th7iLj=Y8VMZ1jyZd2wsFU2pekKVPJXVXrop0OJwECc1A@mail.gmail.com> (raw)
In-Reply-To: <MW5PR11MB590868B18E9361B18B6D4824A96B9@MW5PR11MB5908.namprd11.prod.outlook.com>

> The defined predicate of vector_move_operand composes of (non-imm || (const vector && (reload_completed ? constraint_vi (op) : constraint_wc0(op))).
I may not quit understand why we group them together and named as vector_move.

I forgot the detail reason about that, but vaguely remember that is
for optimization, maybe need Ju-Zhe back and tell us the reason :P

On Fri, Apr 28, 2023 at 10:06 AM Li, Pan2 <pan2.li@intel.com> wrote:
>
> Thanks Kito for the better approach. It works well with the prepared test cases but I may have one question about the semantics of the vector_move_operand.
>
> The defined predicate of vector_move_operand composes of (non-imm || (const vector && (reload_completed ? constraint_vi (op) : constraint_wc0(op))).
> I may not quit understand why we group them together and named as vector_move.
>
> Another difference is that it will act on combine pass which is more generic than the PATCH v1 (which acts on split2 pass).
>
> Pan
>
> -----Original Message-----
> From: Kito Cheng <kito.cheng@sifive.com>
> Sent: Thursday, April 27, 2023 11:00 PM
> To: Li, Pan2 <pan2.li@intel.com>
> Cc: gcc-patches@gcc.gnu.org; juzhe.zhong@rivai.ai; Wang, Yanzhang <yanzhang.wang@intel.com>
> Subject: Re: [PATCH] RISC-V: Allow RVV VMS{Compare}(V1, V1) simplify to VMCLR
>
> > Could you try something like this? that should be more generic:
> >
> > (define_split
> >  [(set (match_operand:VB 0 "register_operand")
> >        (if_then_else:VB
> >          (unspec:VB
> >            [(match_operand:VB 1 "vector_all_trues_mask_operand")
> >             (match_operand 4 "vector_length_operand")
> >             (match_operand 5 "const_int_operand")
> >             (match_operand 6 "const_int_operand")
> >             (reg:SI VL_REGNUM)
> >             (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE)
> >          (match_operand:VB 3 "vector_move_operand")
> >          (match_operand:VB 2 "vector_undef_operand")))]
> > "TARGET_VECTOR && reload_completed"
>
> Remove the reload_completed should work well, but you might need more test, I didn't run full test on this change :P
>
> >  [(const_int 0)]
> >  {
> >    emit_insn (gen_pred_mov (<MODE>mode, operands[0], CONST1_RTX (<MODE>mode),
> >                             RVV_VUNDEF (<MODE>mode), CONST0_RTX (<MODE>mode),
> >                             operands[4], operands[5]));
> >    DONE;
> >  }
> > )

  reply	other threads:[~2023-04-28  6:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-27 14:30 pan2.li
2023-04-27 14:57 ` Kito Cheng
2023-04-27 15:00   ` Kito Cheng
2023-04-28  2:06     ` Li, Pan2
2023-04-28  6:35       ` Kito Cheng [this message]
2023-04-28  2:46 ` [PATCH v2] " pan2.li
2023-04-28  6:40   ` Kito Cheng
2023-04-28  6:45     ` Li, Pan2
2023-04-28  9:14       ` Li, Pan2
2023-04-28 12:36         ` Kito Cheng
2023-04-28 13:04           ` 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='CALLt3Th7iLj=Y8VMZ1jyZd2wsFU2pekKVPJXVXrop0OJwECc1A@mail.gmail.com' \
    --to=kito.cheng@sifive.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=juzhe.zhong@rivai.ai \
    --cc=pan2.li@intel.com \
    --cc=yanzhang.wang@intel.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).