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,
	jeffreyalaw@gmail.com,  rdapp.gcc@gmail.com
Subject: Re: [PATCH V2] RISC-V: Add basic vec_init for VLS RVV auto-vectorization
Date: Fri, 12 May 2023 10:23:47 +0800	[thread overview]
Message-ID: <CA+yXCZA68QUNMVxwM5V9_Mmk=ucY7=O--P9njd4xHe1QyvLz+A@mail.gmail.com> (raw)
In-Reply-To: <20230512013112.276462-1-juzhe.zhong@rivai.ai>

> This patch makes vec_init support common init vector handling (using vslide1down to insert element)
> which can handle any cases of initialization vec but it's not optimal for cases.
>
> And support Case 1 optimizaiton:
> https://godbolt.org/z/Yb9PK9jsz

Don't use godbolt link in comment, because they are not permanently
preserved on the server, also the reference is not fixed since LLVM
trunk could improve.

> LLVM codegen:
> https://godbolt.org/z/xsnavvWqx
>
> ...
> vslide1down.vx (x128 times)
> ...

Drop LLVM codegen here, again, it might improve, healthy competition
is good, but I would like to avoid disparaging other compilers in
comments. :)


> ---
>  gcc/config/riscv/autovec.md                   |  16 ++
>  gcc/config/riscv/riscv-protos.h               |   1 +
>  gcc/config/riscv/riscv-v.cc                   | 127 +++++++++++
>  gcc/config/riscv/vector-iterators.md          |   9 +
>  .../gcc.target/riscv/rvv/autovec/insert-1.c   |  41 ++++
>  .../gcc.target/riscv/rvv/autovec/insert-2.c   |  41 ++++
>  .../gcc.target/riscv/rvv/autovec/insert-3.c   |  41 ++++
>  .../riscv/rvv/autovec/insert_run-1.c          |  46 ++++
>  .../riscv/rvv/autovec/insert_run-2.c          |  46 ++++
>  .../gcc.target/riscv/rvv/autovec/repeat-1.c   |  75 +++++++
>  .../gcc.target/riscv/rvv/autovec/repeat-2.c   |  61 ++++++
>  .../gcc.target/riscv/rvv/autovec/repeat-3.c   |  53 +++++
>  .../gcc.target/riscv/rvv/autovec/repeat-4.c   |  39 ++++
>  .../gcc.target/riscv/rvv/autovec/repeat-5.c   |  74 +++++++
>  .../gcc.target/riscv/rvv/autovec/repeat-6.c   |  78 +++++++
>  .../riscv/rvv/autovec/repeat_run-1.c          | 125 +++++++++++
>  .../riscv/rvv/autovec/repeat_run-2.c          | 145 +++++++++++++
>  .../riscv/rvv/autovec/repeat_run-3.c          | 203 ++++++++++++++++++
>  .../riscv/rvv/autovec/repeat_run-4.c          |  77 +++++++
>  .../riscv/rvv/autovec/repeat_run-5.c          | 124 +++++++++++
>  .../riscv/rvv/autovec/repeat_run-6.c          | 122 +++++++++++
>  21 files changed, 1544 insertions(+)
>  create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/autovec/insert-1.c

Could you reorg the autovec folder to separate vls-vlmax and vla stuffs?

>  create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/autovec/insert-2.c
...
> +/* Initialize register TARGET from the elements in PARALLEL rtx VALS.  */
> +
> +void
> +expand_vec_init (rtx target, rtx vals)
> +{
> +  machine_mode mode = GET_MODE (target);

I would like to add some assertion here to ensure only VLS mode here.

  reply	other threads:[~2023-05-12  2:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-12  1:31 juzhe.zhong
2023-05-12  2:23 ` Kito Cheng [this message]
2023-05-12  3:00   ` juzhe.zhong
  -- strict thread matches above, loose matches on Subject: below --
2023-05-11  9:24 juzhe.zhong

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+yXCZA68QUNMVxwM5V9_Mmk=ucY7=O--P9njd4xHe1QyvLz+A@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).