From: "juzhe.zhong@rivai.ai" <juzhe.zhong@rivai.ai>
To: kito.cheng <kito.cheng@gmail.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>,
Kito.cheng <kito.cheng@sifive.com>,
jeffreyalaw <jeffreyalaw@gmail.com>,
"Robin Dapp" <rdapp.gcc@gmail.com>
Subject: Re: Re: [PATCH] RISC-V: Support in-order floating-point reduction
Date: Thu, 20 Jul 2023 15:53:17 +0800 [thread overview]
Message-ID: <FDF41A3FBC393257+2023072015531684572417@rivai.ai> (raw)
In-Reply-To: <CA+yXCZCPUVOFnqe9e=954YshAyO=R1_rhGjuJxKYWndDSdu9MQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1261 bytes --]
Oh, Yes.
It can be easily addressed by this:
emit_scalar_move_insn (code_for_pred_broadcast (m1_mode), scalar_move_ops);
This patch emit scalar move insn with AVL = 1 for all reduction. It can easily addressed when we recognize it is mask_len_fold_left_plus reduction,
we assign the AVL to the scalar move insn.
juzhe.zhong@rivai.ai
From: Kito Cheng
Date: 2023-07-20 15:42
To: Juzhe-Zhong
CC: gcc-patches; kito.cheng; jeffreyalaw; rdapp.gcc
Subject: Re: [PATCH] RISC-V: Support in-order floating-point reduction
Seems like there is a potential vsetvli optimization chance in the example?
> After this patch:
> foo:
> lui a5,%hi(.LC0)
> flw fa0,%lo(.LC0)(a5)
> ble a1,zero,.L4
> .L3:
> vsetvli a5,a1,e32,m1,ta,ma
> vle32.v v1,0(a0)
> slli a4,a5,2
> vsetivli zero,1,e32,m1,ta,ma
This could just use "vsetvli a5,a1,e32,m1,ta,ma"
> sub a1,a1,a5
> vfmv.s.f v2,fa0
> add a0,a0,a4
> vsetvli zero,a5,e32,m1,ta,ma
And then this can be removed too.
> vfredosum.vs v1,v1,v2
> vfmv.f.s fa0,v1
> bne a1,zero,.L3
> ret
> .L4:
> ret
prev parent reply other threads:[~2023-07-20 7:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-20 7:34 Juzhe-Zhong
2023-07-20 7:41 ` Robin Dapp
2023-07-20 7:42 ` juzhe.zhong
2023-07-20 7:57 ` Robin Dapp
2023-07-20 7:59 ` juzhe.zhong
2023-07-20 8:03 ` Kito Cheng
2023-07-20 8:16 ` juzhe.zhong
2023-07-20 8:24 ` Kito Cheng
2023-07-20 8:53 ` juzhe.zhong
2023-07-20 7:42 ` Kito Cheng
2023-07-20 7:53 ` juzhe.zhong [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=FDF41A3FBC393257+2023072015531684572417@rivai.ai \
--to=juzhe.zhong@rivai.ai \
--cc=gcc-patches@gcc.gnu.org \
--cc=jeffreyalaw@gmail.com \
--cc=kito.cheng@gmail.com \
--cc=kito.cheng@sifive.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).