Commit dd25e724 by Richard Sandiford Committed by Richard Sandiford

Fix vectorizable_live_operation handling of vector booleans

vectorizable_live_operation needs to use BIT_FIELD_REF to extract one
element of a vector.  For a packed vector boolean type, the number of
bits to extract should be taken from TYPE_PRECISION rather than TYPE_SIZE.

This is shown by existing tests once SVE is added.

2017-09-18  Richard Sandiford  <richard.sandiford@linaro.org>
	    Alan Hayward  <alan.hayward@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

gcc/
	* tree-vect-loop.c (vectorizable_live_operation): Fix element size
	calculation for vector booleans.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>

From-SVN: r252930
parent 68a0f2ff
...@@ -2,6 +2,13 @@ ...@@ -2,6 +2,13 @@
Alan Hayward <alan.hayward@arm.com> Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com> David Sherwood <david.sherwood@arm.com>
* tree-vect-loop.c (vectorizable_live_operation): Fix element size
calculation for vector booleans.
2017-09-18 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
* tree-vect-stmts.c (can_vectorize_live_stmts): New function, * tree-vect-stmts.c (can_vectorize_live_stmts): New function,
split out from... split out from...
(vect_transform_stmt): ...here. (vect_transform_stmt): ...here.
......
...@@ -7066,7 +7066,9 @@ vectorizable_live_operation (gimple *stmt, ...@@ -7066,7 +7066,9 @@ vectorizable_live_operation (gimple *stmt,
: gimple_get_lhs (stmt); : gimple_get_lhs (stmt);
lhs_type = TREE_TYPE (lhs); lhs_type = TREE_TYPE (lhs);
bitsize = TYPE_SIZE (TREE_TYPE (vectype)); bitsize = (VECTOR_BOOLEAN_TYPE_P (vectype)
? bitsize_int (TYPE_PRECISION (TREE_TYPE (vectype)))
: TYPE_SIZE (TREE_TYPE (vectype)));
vec_bitsize = TYPE_SIZE (vectype); vec_bitsize = TYPE_SIZE (vectype);
/* Get the vectorized lhs of STMT and the lane to use (counted in bits). */ /* Get the vectorized lhs of STMT and the lane to use (counted in bits). */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment