--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+/* { dg-options "--param=vect-partial-vector-usage=2 -O2" } */
+/* { dg-additional-options "-mavx512vbmi2" { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-additional-options "-march=armv9-a" { target aarch64-*-* } } */
+
+signed int __attribute__ ((noipa))
+fn (signed int n,
+ signed char *restrict a,
+ signed char *restrict b,
+ signed char *restrict c,
+ signed char *restrict d)
+{
+ signed int res = 0;
+
+ for (int i = 0; i < n; ++i)
+ {
+ res += a[i] * b[i];
+ res += i + 1;
+ res += c[i] * d[i];
+ }
+ return res;
+}
bool emulated_mixed_dot_prod = vect_is_emulated_mixed_dot_prod (stmt_info);
unsigned num = vec_oprnds[reduc_index == 0 ? 1 : 0].length ();
+ unsigned mask_index = 0;
for (unsigned i = 0; i < num; ++i)
{
std::swap (vop[0], vop[1]);
}
tree mask = vect_get_loop_mask (loop_vinfo, gsi, masks,
- vec_num * ncopies, vectype_in, i);
+ vec_num * ncopies, vectype_in,
+ mask_index++);
gcall *call = gimple_build_call_internal (cond_fn, 4, mask,
vop[0], vop[1], vop[0]);
new_temp = make_ssa_name (vec_dest, call);
if (masked_loop_p && mask_by_cond_expr)
{
tree mask = vect_get_loop_mask (loop_vinfo, gsi, masks,
- vec_num * ncopies, vectype_in, i);
+ vec_num * ncopies, vectype_in,
+ mask_index++);
build_vect_cond_expr (code, vop, mask, gsi);
}