From: Xiaolong Chen <chenxiaolong@loongson.cn>
To: gcc-patches@gcc.gnu.org
Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn,
chenglulu@loongson.cn, Xiaolong Chen <chenxiaolong@loongson.cn>
Subject: [PATCH v4 13/22] LoongArch: Add tests for ASX xvldrepl/xvstelm instruction generation.
Date: Wed, 13 Sep 2023 11:40:20 +0800 [thread overview]
Message-ID: <20230913034026.7751-4-chenxiaolong@loongson.cn> (raw)
In-Reply-To: <20230913034026.7751-1-chenxiaolong@loongson.cn>
gcc/testsuite/ChangeLog:
* gcc.target/loongarch/vector/lasx/lasx-xvldrepl.c: New test.
* gcc.target/loongarch/vector/lasx/lasx-xvstelm.c: New test.
---
.../loongarch/vector/lasx/lasx-xvldrepl.c | 16 ++++++++++++++++
.../loongarch/vector/lasx/lasx-xvstelm.c | 14 ++++++++++++++
2 files changed, 30 insertions(+)
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvldrepl.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvstelm.c
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvldrepl.c b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvldrepl.c
new file mode 100644
index 00000000000..10556795119
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvldrepl.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -mlasx" } */
+/* { dg-final { scan-assembler-times "xvldrepl.w" 2} } */
+
+#define N 258
+
+float a[N], b[N], c[N];
+
+void
+test ()
+{
+ for (int i = 0; i < 256; i++)
+ {
+ a[i] = c[0] * b[i] + c[1];
+ }
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvstelm.c b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvstelm.c
new file mode 100644
index 00000000000..1a7b0e86f8b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvstelm.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -mlasx" } */
+/* { dg-final { scan-assembler-times "xvstelm.w" 8} } */
+
+#define LEN 256
+
+float a[LEN], b[LEN], c[LEN];
+
+void
+test ()
+{
+ for (int i = 0; i < LEN; i += 2)
+ a[i] = b[i] + c[i];
+}
--
2.20.1
next prev parent reply other threads:[~2023-09-13 3:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-13 3:40 [PATCH v4 10/22] LoongArch: Add tests for ASX vector xvssran/xvssrani/xvssrarn/xvssrarni/xvssrln/ xvssrlni/xvssrlrn/xvssrlrni instructions Xiaolong Chen
2023-09-13 3:40 ` [PATCH v4 11/22] LoongArch: Add tests for ASX vector xvbitclr/xvbitclri/xvbitrev/xvbitrevi/ xvbitsel/xvbitseli/xvbitset/xvbitseti/xvclo/xvclz/xvpcnt instructions Xiaolong Chen
2023-09-13 3:40 ` [PATCH v4 12/22] LoongArch: Add tests for ASX builtin functions Xiaolong Chen
2023-09-13 3:40 ` Xiaolong Chen [this message]
2023-09-13 3:40 ` [PATCH v4 14/22] LoongArch: Add tests for ASX vector floating-point operation instruction Xiaolong Chen
2023-09-13 3:40 ` [PATCH v4 15/22] LoongArch: Add tests for ASX vector floating-point conversion instruction Xiaolong Chen
2023-09-13 3:40 ` [PATCH v4 16/22] LoongArch: Add tests for ASX vector comparison and selection instruction Xiaolong Chen
2023-09-13 3:40 ` [PATCH v4 17/22] LoongArch: Add tests for ASX vector xvfnmadd/xvfrstp/xvfstpi/xvhsubw/ xvmsub/xvrotr/xvrotri/xvld/xvst instructions Xiaolong Chen
2023-09-13 3:40 ` [PATCH v4 18/22] LoongArch: Add tests for ASX vector xvabsd/xvavg/xvavgr/xvbsll/xvbsrl/xvneg/ xvsat instructions Xiaolong Chen
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=20230913034026.7751-4-chenxiaolong@loongson.cn \
--to=chenxiaolong@loongson.cn \
--cc=chenglulu@loongson.cn \
--cc=gcc-patches@gcc.gnu.org \
--cc=i@xen0n.name \
--cc=xry111@xry111.site \
--cc=xuchenghua@loongson.cn \
/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).