Allow vector CONSTs
commitb58a8b74c28dc328a45817255978d3f6e119ff82
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 1 Nov 2017 10:37:03 +0000 (1 10:37 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 1 Nov 2017 10:37:03 +0000 (1 10:37 +0000)
treefa771154bb36a0e333d0f1ec22f6a13d31021200
parent98d31d3a185b8b5e770ad886f0943556e071c241
Allow vector CONSTs

This patch allows (const ...) wrappers to be used for rtx vector
constants, as an alternative to const_vector.  This is useful
for SVE, where the number of elements isn't known until runtime.

It could also be useful in future for fixed-length vectors, to
reduce the amount of memory needed to represent simple constants
with high element counts.  However, one nice thing about keeping
it restricted to variable-length vectors is that there is never
any need to handle combinations of (const ...) and CONST_VECTOR.

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

gcc/
* doc/rtl.texi (const): Update description of address constants.
Say that vector constants are allowed too.
* common.md (E, F): Use CONSTANT_P instead of checking for
CONST_VECTOR.
* emit-rtl.c (gen_lowpart_common): Use const_vec_p instead of
checking for CONST_VECTOR.
* expmed.c (make_tree): Use build_vector_from_val for a CONST
VEC_DUPLICATE.
* expr.c (expand_expr_real_2): Check for vector modes instead
of checking for CONST_VECTOR.
* rtl.h (const_vec_p): New function.
(const_vec_duplicate_p): Check for a CONST VEC_DUPLICATE.
(unwrap_const_vec_duplicate): Handle them here too.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254296 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/common.md
gcc/doc/rtl.texi
gcc/emit-rtl.c
gcc/expmed.c
gcc/expr.c
gcc/rtl.h