2014-12-04 Yvan Roux <yvan.roux@linaro.org>
Backport from trunk r215475.
2014-09-22 Alan Lawrence <alan.lawrence@arm.com>
* gcc.dg/vect/vect-reduc-or_1.c: New test.
* gcc.dg/vect/vect-reduc-or_2.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@218367
138bc75d-0d04-0410-961f-
82ee72b054a4
2014-12-04 Yvan Roux <yvan.roux@linaro.org>
+ Backport from trunk r215475.
+ 2014-09-22 Alan Lawrence <alan.lawrence@arm.com>
+
+ * gcc.dg/vect/vect-reduc-or_1.c: New test.
+ * gcc.dg/vect/vect-reduc-or_2.c: Likewise.
+
+2014-12-04 Yvan Roux <yvan.roux@linaro.org>
+
Backport from trunk r215473.
2014-09-22 Alan Lawrence <alan.lawrence@arm.com>
--- /dev/null
+/* { dg-require-effective-target whole_vector_shift } */
+
+/* Write a reduction loop to be reduced using vector shifts. */
+
+extern void abort(void);
+
+unsigned char in[16] __attribute__((__aligned__(16)));
+
+int
+main (unsigned char argc, char **argv)
+{
+ unsigned char i = 0;
+ unsigned char sum = 1;
+
+ for (i = 0; i < 16; i++)
+ in[i] = (i + i + 1) & 0xfd;
+
+ /* Prevent constant propagation of the entire loop below. */
+ asm volatile ("" : : : "memory");
+
+ for (i = 0; i < 16; i++)
+ sum |= in[i];
+
+ if (sum != 29)
+ {
+ __builtin_printf("Failed %d\n", sum);
+ abort();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "Reduce using vector shifts" "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
--- /dev/null
+/* { dg-require-effective-target whole_vector_shift } */
+
+/* Write a reduction loop to be reduced using vector shifts and folded. */
+
+extern void abort(void);
+
+int
+main (unsigned char argc, char **argv)
+{
+ unsigned char in[16] __attribute__((aligned(16)));
+ unsigned char i = 0;
+ unsigned char sum = 1;
+
+ for (i = 0; i < 16; i++)
+ in[i] = (i + i + 1) & 0xfd;
+
+ for (i = 0; i < 16; i++)
+ sum |= in[i];
+
+ if (sum != 29)
+ {
+ __builtin_printf("Failed %d\n", sum);
+ abort();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "Reduce using vector shifts" "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+