public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-2795] Add tests for PR tree-optimization/88531
@ 2021-08-07 14:35 H.J. Lu
  0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 2021-08-07 14:35 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:6866f4819ad8e6e62fef2177520f9fb217dfa353

commit r12-2795-g6866f4819ad8e6e62fef2177520f9fb217dfa353
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sat Aug 7 07:29:04 2021 -0700

    Add tests for PR tree-optimization/88531
    
            PR tree-optimization/88531
            * gcc.target/i386/pr88531-1a.c: New test.
            * gcc.target/i386/pr88531-1b.c: Likewise.
            * gcc.target/i386/pr88531-1c.c: Likewise.
            * gcc.target/i386/pr88531-2a.c: Likewise.
            * gcc.target/i386/pr88531-2b.c: Likewise.
            * gcc.target/i386/pr88531-2c.c: Likewise.

Diff:
---
 gcc/testsuite/gcc.target/i386/pr88531-1a.c | 19 +++++++++++++++++++
 gcc/testsuite/gcc.target/i386/pr88531-1b.c |  8 ++++++++
 gcc/testsuite/gcc.target/i386/pr88531-1c.c |  8 ++++++++
 gcc/testsuite/gcc.target/i386/pr88531-2a.c | 19 +++++++++++++++++++
 gcc/testsuite/gcc.target/i386/pr88531-2b.c |  6 ++++++
 gcc/testsuite/gcc.target/i386/pr88531-2c.c |  6 ++++++
 6 files changed, 66 insertions(+)

diff --git a/gcc/testsuite/gcc.target/i386/pr88531-1a.c b/gcc/testsuite/gcc.target/i386/pr88531-1a.c
new file mode 100644
index 00000000000..d1c29b2c990
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr88531-1a.c
@@ -0,0 +1,19 @@
+/* { dg-do compile { target lp64 } } */
+/* { dg-options "-O3 -march=x86-64 -mfpmath=sse" } */
+
+#include <stdint.h>
+
+#define loop_t uint32_t
+#define idx_t uint32_t
+
+void loop(double * const __restrict__ dst,
+          double const * const __restrict__ src,
+          idx_t const * const __restrict__ idx,
+          loop_t const begin,
+          loop_t const end)
+{
+  for (loop_t i = begin; i < end; ++i)
+    dst[i] = 42.0 * src[idx[i]];
+}
+
+/* { dg-final { scan-assembler-times "mulpd" 2 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr88531-1b.c b/gcc/testsuite/gcc.target/i386/pr88531-1b.c
new file mode 100644
index 00000000000..812c8a10fab
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr88531-1b.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=skylake -mfpmath=sse" } */
+
+#include "pr88531-1a.c"
+
+/* { dg-final { scan-assembler-times "vgatherdpd" 4 { target { ! lp64 } } } } */
+/* { dg-final { scan-assembler-times "vgatherqpd" 4 { target lp64 } } } */
+/* { dg-final { scan-assembler-times "vmulpd" 4 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr88531-1c.c b/gcc/testsuite/gcc.target/i386/pr88531-1c.c
new file mode 100644
index 00000000000..43fc5913ed3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr88531-1c.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=skylake-avx512 -mfpmath=sse" } */
+
+#include "pr88531-1a.c"
+
+/* { dg-final { scan-assembler-times "vgatherdpd" 4 { target { ! lp64 } } } } */
+/* { dg-final { scan-assembler-times "vgatherqpd" 4 { target lp64 } } } */
+/* { dg-final { scan-assembler-times "vmulpd" 4 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr88531-2a.c b/gcc/testsuite/gcc.target/i386/pr88531-2a.c
new file mode 100644
index 00000000000..8ab2b1385eb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr88531-2a.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=x86-64 -mfpmath=sse" } */
+
+#include <stdint.h>
+
+#define loop_t uint32_t
+#define idx_t uint32_t
+
+void loop(float * const __restrict__ dst,
+          float const * const __restrict__ src,
+          idx_t const * const __restrict__ idx,
+          loop_t const begin,
+          loop_t const end)
+{
+  for (loop_t i = begin; i < end; ++i)
+    dst[i] = 42.0 * src[idx[i]];
+}
+
+/* { dg-final { scan-assembler-times "mulps" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr88531-2b.c b/gcc/testsuite/gcc.target/i386/pr88531-2b.c
new file mode 100644
index 00000000000..011607c3d54
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr88531-2b.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=skylake -mfpmath=sse" } */
+
+#include "pr88531-2a.c"
+
+/* { dg-final { scan-assembler-times "vmulps" 2 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr88531-2c.c b/gcc/testsuite/gcc.target/i386/pr88531-2c.c
new file mode 100644
index 00000000000..0f7ec3832f8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr88531-2c.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=skylake-avx512 -mfpmath=sse" } */
+
+#include "pr88531-2a.c"
+
+/* { dg-final { scan-assembler-times "vmulps" 2 } } */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-07 14:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-07 14:35 [gcc r12-2795] Add tests for PR tree-optimization/88531 H.J. Lu

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).