Extra subreg fold for variable-length CONST_VECTORs
commita57fbd3a95f6996a5e951e0981e5889474487bb0
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 13 Jan 2018 17:50:13 +0000 (13 17:50 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 13 Jan 2018 17:50:13 +0000 (13 17:50 +0000)
tree24aedf96f7279bcfe8e5ea3de20792e7d0f722dc
parent18283ee27bd040e004dc470e374f1b753222e35c
Extra subreg fold for variable-length CONST_VECTORs

The SVE support for the new CONST_VECTOR encoding needs to be able
to extract the first N bits of the vector and duplicate it.  This patch
adds a simplify_subreg rule for that.

The code is covered by the gcc.target/aarch64/sve_slp_*.c tests.

2018-01-13  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
* simplify-rtx.c (simplify_immed_subreg): Add an inner_bytes
parameter and use it instead of GET_MODE_SIZE (innermode).  Use
inner_bytes * BITS_PER_UNIT instead of GET_MODE_BITSIZE (innermode).
Use CEIL (inner_bytes, GET_MODE_UNIT_SIZE (innermode)) instead of
GET_MODE_NUNITS (innermode).  Also add a first_elem parameter.
Change innermode from fixed_mode_size to machine_mode.
(simplify_subreg): Update call accordingly.  Handle a constant-sized
subreg of a variable-length CONST_VECTOR.

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