--- /dev/null
+/* { dg-do compile } */
+/* { dg-additional-options "-Ofast" } */
+/* { dg-require-effective-target vect_double } */
+
+void foo1x1(double* restrict y, const double* restrict x, int clen)
+{
+ int xi = clen & 2;
+ double f_re = x[0+xi+0];
+ double f_im = x[4+xi+0];
+ int clen2 = (clen+xi) * 2;
+#pragma GCC unroll 0
+ for (int c = 0; c < clen2; c += 8) {
+#pragma GCC unroll 4
+ for (int k = 0; k < 4; ++k) {
+ double x_re = x[k];
+ double x_im = x[c+4+k];
+ double y_re = y[c+0+k];
+ double y_im = y[c+4+k];
+ y_re = y_re - x_re * f_re - x_im * f_im;;
+ y_im = y_im + x_re * f_im - x_im * f_re;
+ y[c+0+k] = y_re;
+ y[c+4+k] = y_im;
+ }
+ }
+}
+
+/* { dg-final { scan-tree-dump "vectorizing stmts using SLP" "vect" } } */
+/* { dg-final { scan-tree-dump "Loop contains only SLP stmts" "vect" } } */
/* Helper for building an associated SLP node chain. */
static void
-vect_slp_build_two_operator_nodes (slp_tree perm,
+vect_slp_build_two_operator_nodes (slp_tree perm, tree vectype,
slp_tree op0, slp_tree op1,
stmt_vec_info oper1, stmt_vec_info oper2,
vec<std::pair<unsigned, unsigned> > lperm)
{
unsigned group_size = SLP_TREE_LANES (op1);
- tree vectype = SLP_TREE_VECTYPE (op1);
slp_tree child1 = new _slp_tree;
SLP_TREE_DEF_TYPE (child1) = vect_internal_def;
for (unsigned lane = 0; lane < group_size; ++lane)
lperm.quick_push (std::make_pair
(chains[lane][i].code != chains[0][i].code, lane));
- vect_slp_build_two_operator_nodes (child, op0, op1,
+ vect_slp_build_two_operator_nodes (child, vectype, op0, op1,
(chains[0][i].code == code
? op_stmt_info
: other_op_stmt_info),