Make more use of GET_MODE_UNIT_SIZE
commit466a35ffa2b4dc4fc21a8479d1335a161788c78d
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 13 Oct 2017 09:41:39 +0000 (13 09:41 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 13 Oct 2017 09:41:39 +0000 (13 09:41 +0000)
tree34cd9d3afa018eb2d3ab1f7ee4b142e66c6cda7f
parentc04949fe17d4949bbe7310dd8737816342d3c1fd
Make more use of GET_MODE_UNIT_SIZE

This patch uses GET_MODE_UNIT_SIZE instead of GET_MODE_SIZE in
cases where, for compound modes, the mode of the scalar elements
is what matters.  E.g. the choice between truncation and extension
is really based on the modes of the consistuent scalars rather
than the mode as a whole.

None of the existing code was wrong.  The patch simply makes
things easier when converting to variable-sized modes.

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

gcc/
* optabs.c (add_equal_note): Use GET_MODE_UNIT_SIZE.
(widened_mode): Likewise.
(expand_unop): Likewise.
* ree.c (transform_ifelse): Likewise.
(merge_def_and_ext): Likewise.
(combine_reaching_defs): Likewise.
* simplify-rtx.c (simplify_unary_operation_1): Likewise.

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