--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-fgimple -O2" } */
+
+typedef char v8qi __attribute__ ((vector_size (8)));
+typedef char v16qi __attribute__ ((vector_size (16)));
+
+v16qi __GIMPLE (ssa)
+foo (v8qi a, v8qi b)
+{
+ v16qi _5;
+
+ __BB(2):
+ _5 = __VEC_PERM (a, b, _Literal (unsigned char [[gnu::vector_size(16)]]) { _Literal (unsigned char) 0, _Literal (unsigned char) 16, _Literal (unsigned char) 1, _Literal (unsigned char) 17, _Literal (unsigned char) 2, _Literal (unsigned char) 18, _Literal (unsigned char) 3, _Literal (unsigned char) 19, _Literal (unsigned char) 4, _Literal (unsigned char) 20, _Literal (unsigned char) 5, _Literal (unsigned char) 21, _Literal (unsigned char) 6, _Literal (unsigned char) 22, _Literal (unsigned char) 7, _Literal (unsigned char) 23 });
+ return _5;
+
+}
tree mask = gimple_assign_rhs3 (stmt);
tree vec0 = gimple_assign_rhs1 (stmt);
tree vec1 = gimple_assign_rhs2 (stmt);
+ tree res_vect_type = TREE_TYPE (gimple_assign_lhs (stmt));
tree vect_type = TREE_TYPE (vec0);
tree mask_type = TREE_TYPE (mask);
tree vect_elt_type = TREE_TYPE (vect_type);
location_t loc = gimple_location (gsi_stmt (*gsi));
unsigned i;
- if (!TYPE_VECTOR_SUBPARTS (vect_type).is_constant (&elements))
+ if (!TYPE_VECTOR_SUBPARTS (res_vect_type).is_constant (&elements))
return;
if (TREE_CODE (mask) == SSA_NAME)
}
if (constant_p)
- constr = build_vector_from_ctor (vect_type, v);
+ constr = build_vector_from_ctor (res_vect_type, v);
else
- constr = build_constructor (vect_type, v);
+ constr = build_constructor (res_vect_type, v);
gimple_assign_set_rhs_from_tree (gsi, constr);
update_stmt (gsi_stmt (*gsi));
}