Use (CONST_VECTOR|GET_MODE)_NUNITS in simplify-rtx.c
commit9a2f49ee363469b9ceb866572885c7e0813ebb66
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 1 Nov 2017 14:06:50 +0000 (1 14:06 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 1 Nov 2017 14:06:50 +0000 (1 14:06 +0000)
tree9e495e9d8e1dfea243a6580db21d16fb76b82b37
parenta543234db0acd1b4e68442d3979518be25331791
Use (CONST_VECTOR|GET_MODE)_NUNITS in simplify-rtx.c

This patch avoids some calculations of the form:

  GET_MODE_SIZE (vector_mode) / GET_MODE_SIZE (element_mode)

in simplify-rtx.c.  If we're dealing with CONST_VECTORs, it's better
to use CONST_VECTOR_NUNITS, since that remains constant even after the
SVE patches.  In other cases we can get the number from GET_MODE_NUNITS.

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

gcc/
* simplify-rtx.c (simplify_const_unary_operation): Use GET_MODE_NUNITS
and CONST_VECTOR_NUNITS instead of computing the number of units from
the byte sizes of the vector and element.
(simplify_binary_operation_1): Likewise.
(simplify_const_binary_operation): Likewise.
(simplify_ternary_operation): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254311 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/simplify-rtx.c