Handle VIEW_CONVERT_EXPR for variable-length vectors

Programming / Compilers / GCC - rsandifo [138bc75d-0d04-0410-961f-82ee72b054a4] - 18 November 2019 15:27 UTC

This patch handles VIEW_CONVERT_EXPRs of variable-length VECTOR_CSTs by adding tree-level versions of native_decode_vector_rtx and simplify_const_vector_subreg. It uses the same code for fixed-length
vectors, both to get more coverage and because operating directly on the compressed encoding should be more efficient for longer vectors with a regular pattern.

The structure and comments are very similar between the tree and rtx routines.

2019-11-18 Richard Sandiford

- fold-const.c (native_encode_vector): Turn into a wrapper function, splitting the main code out into... (native_encode_vector_part): ...this new function. (native_decode_vector_tree): New function. (fold_view_convert_vector_encoding): Likewise. (fold_view_convert_expr): Use it for converting VECTOR_CSTs to VECTOR_TYPEs.

- gcc.target/aarch64/sve/acle/general/temporaries_1.c: New test.

55c056a85ab Handle VIEW_CONVERT_EXPR for variable-length vectors
gcc/ChangeLog | 10 ++
gcc/fold-const.c | 139 +++++++++++++++++++--
gcc/testsuite/ChangeLog | 4 +
.../aarch64/sve/acle/general/temporaries_1.c | 70 +++++++++++
4 files changed, 214 insertions(+), 9 deletions(-)

Upstream: gcc.gnu.org

  • Share