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" <juzhe.zhong@rivai.ai>
Cc: jeffreyalaw <jeffreyalaw@gmail.com>,
	gcc-patches <gcc-patches@gcc.gnu.org>,
	 palmer <palmer@dabbelt.com>
Subject: Re: Re: [PATCH] RISC-V: Fix redundant vmv1r.v instruction in vmsge.vx codegen
Date: Wed, 26 Apr 2023 12:22:15 +0800	[thread overview]
Message-ID: <CA+yXCZDJKaw31VAuRJwnk4q9HLdUg=+j4pU5=ty8wTRHahD76g@mail.gmail.com> (raw)
In-Reply-To: <B233F0EA15350EB0+20230424110924792192125@rivai.ai>

Committed to trunk

On Mon, Apr 24, 2023 at 11:09 AM juzhe.zhong@rivai.ai
<juzhe.zhong@rivai.ai> wrote:
>
> I can push codes yet. Can you push them for me?
>
>
>
> juzhe.zhong@rivai.ai
>
> From: Jeff Law
> Date: 2023-04-22 04:42
> To: juzhe.zhong; gcc-patches
> CC: kito.cheng; palmer
> Subject: Re: [PATCH] RISC-V: Fix redundant vmv1r.v instruction in vmsge.vx codegen
>
>
> On 3/22/23 06:15, juzhe.zhong@rivai.ai wrote:
> > From: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
> >
> > Current expansion of vmsge will make RA produce redundant vmv1r.v.
> >
> > testcase:
> > void f1 (void * in, void *out, int32_t x)
> > {
> >      vbool32_t mask = *(vbool32_t*)in;
> >      asm volatile ("":::"memory");
> >      vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4);
> >      vint32m1_t v2 = __riscv_vle32_v_i32m1_m (mask, in, 4);
> >      vbool32_t m3 = __riscv_vmsge_vx_i32m1_b32 (v, x, 4);
> >      vbool32_t m4 = __riscv_vmsge_vx_i32m1_b32_mu (mask, m3, v, x, 4);
> >      m4 = __riscv_vmsge_vv_i32m1_b32_m (m4, v2, v2, 4);
> >      __riscv_vsm_v_b32 (out, m4, 4);
> > }
> >
> > Before this patch:
> > f1:
> >          vsetvli a5,zero,e8,mf4,ta,ma
> >          vlm.v   v0,0(a0)
> >          vsetivli        zero,4,e32,m1,ta,mu
> >          vle32.v v3,0(a0)
> >          vle32.v v2,0(a0),v0.t
> >          vmslt.vx        v1,v3,a2
> >          vmnot.m v1,v1
> >          vmslt.vx        v1,v3,a2,v0.t
> >          vmxor.mm        v1,v1,v0
> >          vmv1r.v v0,v1
> >          vmsge.vv        v2,v2,v2,v0.t
> >          vsm.v   v2,0(a1)
> >          ret
> >
> > After this patch:
> > f1:
> >          vsetvli a5,zero,e8,mf4,ta,ma
> >          vlm.v   v0,0(a0)
> >          vsetivli        zero,4,e32,m1,ta,mu
> >          vle32.v v3,0(a0)
> >          vle32.v v2,0(a0),v0.t
> >          vmslt.vx        v1,v3,a2
> >          vmnot.m v1,v1
> >          vmslt.vx        v1,v3,a2,v0.t
> >          vmxor.mm        v0,v1,v0
> >          vmsge.vv        v2,v2,v2,v0.t
> >          vsm.v   v2,0(a1)
> >          ret
> >
> >
> > gcc/ChangeLog:
> >
> >          * config/riscv/vector.md: Fix redundant vmv1r.v.
> >
> > gcc/testsuite/ChangeLog:
> >
> >          * gcc.target/riscv/rvv/base/binop_vx_constraint-150.c: Adapt assembly check.
> OK.  Please push this to the trunk.
>
> jeff
>

      reply	other threads:[~2023-04-26  4:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-22 12:15 juzhe.zhong
2023-03-23  3:27 ` Kito Cheng
2023-04-21 20:42 ` Jeff Law
2023-04-24  3:09   ` juzhe.zhong
2023-04-26  4:22     ` Kito Cheng [this message]

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+yXCZDJKaw31VAuRJwnk4q9HLdUg=+j4pU5=ty8wTRHahD76g@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 \
    /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).