* [PATCH V2] RISC-V: Add ZVFHMIN block autovec testcase
@ 2023-06-12 9:44 juzhe.zhong
2023-06-12 9:46 ` Robin Dapp
0 siblings, 1 reply; 4+ messages in thread
From: juzhe.zhong @ 2023-06-12 9:44 UTC (permalink / raw)
To: gcc-patches
Cc: kito.cheng, kito.cheng, palmer, palmer, jeffreyalaw, rdapp.gcc,
Juzhe-Zhong
From: Juzhe-Zhong <juzhe.zhong@rivai.ai>
To be safe, add ZVFHMIN autovec block testcase to make sure
we won't enable autovec in ZVFHMIN by mistakes.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/autovec/zvfhmin-1.c: New test.
---
.../gcc.target/riscv/rvv/autovec/zvfhmin-1.c | 35 +++++++++++++++++++
1 file changed, 35 insertions(+)
create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/autovec/zvfhmin-1.c
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/zvfhmin-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/zvfhmin-1.c
new file mode 100644
index 00000000000..08da48d0270
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/zvfhmin-1.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv32gcv_zvfhmin -mabi=ilp32d --param riscv-autovec-preference=scalable -fdump-tree-vect-details" } */
+
+void f0 (_Float16 * __restrict a, _Float16 * __restrict b, int n)
+{
+ for (int i = 0; i < n; i++)
+ a[i] = -b[i];
+}
+
+void f1 (_Float16 * __restrict a, _Float16 * __restrict b, int n)
+{
+ for (int i = 0; i < n; i++)
+ a[i] = a[i]+b[i];
+}
+
+void f2 (_Float16 * __restrict a, _Float16 * __restrict b, int n)
+{
+ for (int i = 0; i < n; i++)
+ a[i] = a[i]-b[i];
+}
+
+void f3 (_Float16 * __restrict a, _Float16 * __restrict b, int n)
+{
+ for (int i = 0; i < n; i++)
+ a[i] = a[i]*b[i];
+}
+
+void f4 (_Float16 * __restrict a, _Float16 * __restrict b, int n)
+{
+ for (int i = 0; i < n; i++)
+ a[i] = a[i]/b[i];
+}
+
+/* We can't enable FP16 NEG/PLUS/MINUS/MULT/DIV auto-vectorization when -march="*zvfhmin*". */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 0 "vect" } } */
--
2.36.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH V2] RISC-V: Add ZVFHMIN block autovec testcase
2023-06-12 9:44 [PATCH V2] RISC-V: Add ZVFHMIN block autovec testcase juzhe.zhong
@ 2023-06-12 9:46 ` Robin Dapp
2023-06-12 12:18 ` Kito Cheng
0 siblings, 1 reply; 4+ messages in thread
From: Robin Dapp @ 2023-06-12 9:46 UTC (permalink / raw)
To: juzhe.zhong, gcc-patches
Cc: rdapp.gcc, kito.cheng, kito.cheng, palmer, palmer, jeffreyalaw
> +/* We can't enable FP16 NEG/PLUS/MINUS/MULT/DIV auto-vectorization when -march="*zvfhmin*". */
> +/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 0 "vect" } } */
Thanks. OK from my side.
Regards
Robin
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH V2] RISC-V: Add ZVFHMIN block autovec testcase
2023-06-12 9:46 ` Robin Dapp
@ 2023-06-12 12:18 ` Kito Cheng
2023-06-12 12:23 ` Li, Pan2
0 siblings, 1 reply; 4+ messages in thread
From: Kito Cheng @ 2023-06-12 12:18 UTC (permalink / raw)
To: Robin Dapp
Cc: juzhe.zhong, gcc-patches, kito.cheng, palmer, palmer, jeffreyalaw
LGTM too, thanks
On Mon, Jun 12, 2023 at 5:46 PM Robin Dapp via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> > +/* We can't enable FP16 NEG/PLUS/MINUS/MULT/DIV auto-vectorization when -march="*zvfhmin*". */
> > +/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 0 "vect" } } */
>
> Thanks. OK from my side.
>
> Regards
> Robin
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH V2] RISC-V: Add ZVFHMIN block autovec testcase
2023-06-12 12:18 ` Kito Cheng
@ 2023-06-12 12:23 ` Li, Pan2
0 siblings, 0 replies; 4+ messages in thread
From: Li, Pan2 @ 2023-06-12 12:23 UTC (permalink / raw)
To: Kito Cheng, Robin Dapp
Cc: juzhe.zhong, gcc-patches, kito.cheng, palmer, palmer, jeffreyalaw
Committed, thanks Kito and Robin.
Pan
-----Original Message-----
From: Gcc-patches <gcc-patches-bounces+pan2.li=intel.com@gcc.gnu.org> On Behalf Of Kito Cheng via Gcc-patches
Sent: Monday, June 12, 2023 8:19 PM
To: Robin Dapp <rdapp.gcc@gmail.com>
Cc: juzhe.zhong@rivai.ai; gcc-patches@gcc.gnu.org; kito.cheng@sifive.com; palmer@dabbelt.com; palmer@rivosinc.com; jeffreyalaw@gmail.com
Subject: Re: [PATCH V2] RISC-V: Add ZVFHMIN block autovec testcase
LGTM too, thanks
On Mon, Jun 12, 2023 at 5:46 PM Robin Dapp via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
>
> > +/* We can't enable FP16 NEG/PLUS/MINUS/MULT/DIV auto-vectorization
> > +when -march="*zvfhmin*". */
> > +/* { dg-final { scan-tree-dump-times "vectorized 1 loops in
> > +function" 0 "vect" } } */
>
> Thanks. OK from my side.
>
> Regards
> Robin
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-06-12 12:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-12 9:44 [PATCH V2] RISC-V: Add ZVFHMIN block autovec testcase juzhe.zhong
2023-06-12 9:46 ` Robin Dapp
2023-06-12 12:18 ` Kito Cheng
2023-06-12 12:23 ` Li, Pan2
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).