This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, testsuite] new SLP test for complex data type


This patch adds a new test to check that SLP is not making mistake
and checks that all loads are in right order.

Tested on x86 and powerpc.
OK for mainline?

testsuite/ChangeLog

2008-08-04  Victor Kaplansky  <victork@il.ibm.com>

       * gcc.dg/vect/vect-complex-5.c: New test.

Index: gcc/testsuite/gcc.dg/vect/vect-complex-5.c>
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect-complex-5.c  (revision 0)
+++ gcc/testsuite/gcc.dg/vect/vect-complex-5.c  (revision 0)
@@ -0,0 +1,45 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdio.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+struct foostr {
+  _Complex short f1;
+  _Complex short f2;
+};
+};
+_Complex short a1[64] __attribute__ ((__aligned__(16)));
+_Complex short a2[64] __attribute__ ((__aligned__(16)));
+_Complex short b1[64] __attribute__ ((__aligned__(16)));
+_Complex short b2[64] __attribute__ ((__aligned__(16)));
+struct foostr c[64] __attribute__ ((__aligned__(16))););
+
+__attribute__ ((noinline)) void
+foo (void)
+{
+  int i;
+
+  for (i = 0; i < N; i++))
+    {
+      c[i].f1 = a1[i] + b1[i];
+      c[i].f2 = a2[i] + b2[i];
+    }
+
+}
+}
+int
+main (void)
+{
+  int i;
+  check_vect ();
+
+  foo ();
+
+  return 0;
+}
+}
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0
"vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]