From: Robin Dapp <rdapp.gcc@gmail.com>
To: Palmer Dabbelt <palmer@dabbelt.com>, gcc-patches@gcc.gnu.org
Cc: rdapp.gcc@gmail.com, richard.guenther@gmail.com,
juzhe.zhong@rivai.ai, Kito Cheng <kito.cheng@gmail.com>,
kito.cheng@sifive.com
Subject: Re: [PATCH V7] RISC-V: RISC-V: Support gather_load/scatter RVV auto-vectorization
Date: Thu, 13 Jul 2023 16:32:56 +0200 [thread overview]
Message-ID: <3d385e0b-1ab9-e4fc-74bc-be52cefe18b2@gmail.com> (raw)
In-Reply-To: <mhng-737ed78a-8e6b-4b3e-90e7-bd8d2be74c21@palmer-ri-x1c9a>
>>>> From my understanding, we dont have RVV instruction for fmax/fmin?
>
> Unless I'm misunderstanding, we do. The ISA manual says
>
> === Vector Floating-Point MIN/MAX Instructions
>
> The vector floating-point `vfmin` and `vfmax` instructions have the
> same behavior as the corresponding scalar floating-point instructions
> in version 2.2 of the RISC-V F/D/Q extension: they perform the `minimumNumber`
> or `maximumNumber` operation on active elements.
>
> ----
> # Floating-point minimum
> vfmin.vv vd, vs2, vs1, vm # Vector-vector
> vfmin.vf vd, vs2, rs1, vm # vector-scalar
>
> # Floating-point maximum
> vfmax.vv vd, vs2, vs1, vm # Vector-vector
> vfmax.vf vd, vs2, rs1, vm # vector-scalar
> ----
>
> so we should be able to match at least some loops.
We're already emitting those (e.g. for a[i] = a[i] > b[i] ? a[i] : b[i])
but for fmin/fmax they are not wired up yet (as opposed to the scalar variants).
Juzhe are you referring to something else? I mean it's always a bit tricky
for backends to verify if the fmin/fmax behavior exactly matches the instruction
regards signaling nans, rounding etc but if the scalar variant is fine
I don't see why the vector variant would be worse.
Regards
Robin
next prev parent reply other threads:[~2023-07-13 14:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-12 9:38 juzhe.zhong
[not found] ` <66564378DDCC57ED+202307121748494317959@rivai.ai>
2023-07-12 21:22 ` 回复: " 钟居哲
2023-07-12 21:48 ` Jeff Law
2023-07-12 22:17 ` 钟居哲
2023-07-12 22:25 ` Jeff Law
2023-07-12 23:30 ` 钟居哲
2023-07-13 7:47 ` Richard Biener
2023-07-13 14:01 ` Jeff Law
2023-07-13 14:05 ` Palmer Dabbelt
2023-07-13 14:32 ` Robin Dapp [this message]
2023-07-13 14:42 ` 钟居哲
2023-07-13 13:58 ` Jeff Law
2023-07-13 1:12 ` 回复: " 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=3d385e0b-1ab9-e4fc-74bc-be52cefe18b2@gmail.com \
--to=rdapp.gcc@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=juzhe.zhong@rivai.ai \
--cc=kito.cheng@gmail.com \
--cc=kito.cheng@sifive.com \
--cc=palmer@dabbelt.com \
--cc=richard.guenther@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).