Make more use of GET_MODE_UNIT_SIZE
authorRichard Sandiford <richard.sandiford@linaro.org>
Fri, 13 Oct 2017 09:41:39 +0000 (09:41 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Fri, 13 Oct 2017 09:41:39 +0000 (09:41 +0000)
commitfb98441af9c84caef6a0e3210ace4b8ffc7e3840
tree34cd9d3afa018eb2d3ab1f7ee4b142e66c6cda7f
parent90f2b7e220df8ce298b2cd8f853a02aaecdbff0b
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.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r253715
gcc/ChangeLog
gcc/optabs.c
gcc/ree.c
gcc/simplify-rtx.c