+2019-11-29 Richard Sandiford <richard.sandiford@arm.com>
+
+ * doc/sourcebuild.texi (vect_bool_cmp): Document.
+ * tree-vect-patterns.c (search_type_for_mask_1): If neither
+ operand to a boolean comparison is a natural vector mask,
+ handle both operands like normal integers instead.
+
2019-11-29 Richard Biener <rguenther@suse.de>
* tree-ssa-sccvn.c (vn_walk_cb_data::push_partial_def): Bail
@item vect_no_bitwise
Target does not support vector bitwise instructions.
+@item vect_bool_cmp
+Target supports comparison of @code{bool} vectors for at least one
+vector length.
+
@item vect_char_add
Target supports addition of @code{char} vectors for at least one
vector length.
+2019-11-29 Richard Sandiford <richard.sandiford@arm.com>
+
+ * gcc.dg/vect/vect-bool-cmp-2.c: New test.
+ * lib/target-supports.exp (check_effective_target_vect_bool_cmp): New
+ effective target procedure.
+
2019-11-29 Tobias Burnus <tobias@codesourcery.com>
* fortran.dg/goacc/common-block-3.f90: Check that unused common-block
--- /dev/null
+/* { dg-do compile } */
+
+void
+f (_Bool *restrict x, _Bool *restrict y)
+{
+ for (int i = 0; i < 128; ++i)
+ x[i] = x[i] == y[i];
+}
+
+/* { dg-final { scan-tree-dump "loop vectorized" "vect" { target vect_bool_cmp } } } */
|| [istarget amdgcn-*-*] }}]
}
+# Return 1 if the target supports comparison of bool vectors for at
+# least one vector length.
+
+proc check_effective_target_vect_bool_cmp { } {
+ return [check_cached_effective_target_indexed vect_bool_cmp {
+ expr { [istarget i?86-*-*] || [istarget x86_64-*-*]
+ || [istarget aarch64*-*-*]
+ || [is-effective-target arm_neon] }}]
+}
+
# Return 1 if the target supports addition of char vectors for at least
# one vector length.
vinfo, cache);
if (!res || (res2 && TYPE_PRECISION (res) > TYPE_PRECISION (res2)))
res = res2;
- break;
+ if (res)
+ break;
}
comp_vectype = get_vectype_for_scalar_type (vinfo, TREE_TYPE (rhs1));