public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-3962] LoongArch: Add tests for ASX xvldrepl/xvstelm instruction generation.
@ 2023-09-14 0:47 LuluCheng
0 siblings, 0 replies; only message in thread
From: LuluCheng @ 2023-09-14 0:47 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:efba540049550ea72cb5d89cc4e213a5b9b2bf48
commit r14-3962-gefba540049550ea72cb5d89cc4e213a5b9b2bf48
Author: Xiaolong Chen <chenxiaolong@loongson.cn>
Date: Tue Sep 12 16:00:48 2023 +0800
LoongArch: Add tests for ASX xvldrepl/xvstelm instruction generation.
gcc/testsuite/ChangeLog:
* gcc.target/loongarch/vector/lasx/lasx-xvldrepl.c: New test.
* gcc.target/loongarch/vector/lasx/lasx-xvstelm.c: New test.
Diff:
---
.../gcc.target/loongarch/vector/lasx/lasx-xvldrepl.c | 16 ++++++++++++++++
.../gcc.target/loongarch/vector/lasx/lasx-xvstelm.c | 14 ++++++++++++++
2 files changed, 30 insertions(+)
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 000000000000..10556795119b
--- /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 000000000000..1a7b0e86f8ba
--- /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];
+}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-09-14 0:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-14 0:47 [gcc r14-3962] LoongArch: Add tests for ASX xvldrepl/xvstelm instruction generation LuluCheng
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).