Add a VEC_SERIES rtl code
commitccc2ef18f544a180d93344f9f56c552cce45a7d9
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 1 Nov 2017 11:22:35 +0000 (1 11:22 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 1 Nov 2017 11:22:35 +0000 (1 11:22 +0000)
treee5beefe9a80252715c035780b1f4819d67302440
parentb58a8b74c28dc328a45817255978d3f6e119ff82
Add a VEC_SERIES rtl code

This patch adds an rtl representation of a vector linear series
of the form:

  a[I] = BASE + I * STEP

Like vec_duplicate;

- the new rtx can be used for both constant and non-constant vectors
- when used for constant vectors it is wrapped in a (const ...)
- the constant form is only used for variable-length vectors;
  fixed-length vectors still use CONST_VECTOR

At the moment the code is restricted to integer elements, to avoid
concerns over floating-point rounding.

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 (vec_series): Document.
(const): Say that the operand can be a vec_series.
* rtl.def (VEC_SERIES): New rtx code.
* rtl.h (const_vec_series_p_1): Declare.
(const_vec_series_p): New function.
* emit-rtl.h (gen_const_vec_series): Declare.
(gen_vec_series): Likewise.
* emit-rtl.c (const_vec_series_p_1, gen_const_vec_series)
(gen_vec_series): Likewise.
* optabs.c (expand_mult_highpart): Use gen_const_vec_series.
* simplify-rtx.c (simplify_unary_operation): Handle negations
of vector series.
(simplify_binary_operation_series): New function.
(simplify_binary_operation_1): Use it.  Handle VEC_SERIES.
(test_vector_ops_series): New function.
(test_vector_ops): Call it.
* config/powerpcspe/altivec.md (altivec_lvsl): Use
gen_const_vec_series.
(altivec_lvsr): Likewise.
* config/rs6000/altivec.md (altivec_lvsl, altivec_lvsr): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254297 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/powerpcspe/altivec.md
gcc/config/rs6000/altivec.md
gcc/doc/rtl.texi
gcc/emit-rtl.c
gcc/emit-rtl.h
gcc/optabs.c
gcc/rtl.def
gcc/rtl.h
gcc/simplify-rtx.c