diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2018-01-10 08:46:07 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2018-01-10 08:46:07 +0000 |
commit | 2072a319569067b9b99154e8d1bbec894034652f (patch) | |
tree | fb71cd4c9d25b4c0689180b831233d246d68e6cb /gcc/rtl.h | |
parent | d89f01a08e67eb856aa03268972dbee7f4e40bd2 (diff) | |
download | gcc-2072a319569067b9b99154e8d1bbec894034652f.zip gcc-2072a319569067b9b99154e8d1bbec894034652f.tar.gz gcc-2072a319569067b9b99154e8d1bbec894034652f.tar.bz2 |
Mostly revert r254296
r254296 added support for (const ...) wrappers around vectors,
but in the end the agreement was to use a variable-length
encoding of CONST_VECTOR (and VECTOR_CST) instead. This patch
therefore reverts the bits that are no longer needed.
The rtl.texi part isn't a full revert, since r254296 also updated the
documentation to mention unspecs in address calculations, and to relax
the requirement that the mode had to be Pmode.
2018-01-10 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
* doc/rtl.texi: Remove documentation of (const ...) wrappers
for vectors, as a partial revert of r254296.
* rtl.h (const_vec_p): Delete.
(const_vec_duplicate_p): Don't test for vector CONSTs.
(unwrap_const_vec_duplicate, const_vec_series_p): Likewise.
* expmed.c (make_tree): Likewise.
Revert:
* 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.
From-SVN: r256421
Diffstat (limited to 'gcc/rtl.h')
-rw-r--r-- | gcc/rtl.h | 41 |
1 files changed, 6 insertions, 35 deletions
@@ -2935,24 +2935,14 @@ extern rtx shallow_copy_rtx (const_rtx CXX_MEM_STAT_INFO); extern int rtx_equal_p (const_rtx, const_rtx); extern bool rtvec_all_equal_p (const_rtvec); -/* Return true if X is some form of vector constant. */ - -inline bool -const_vec_p (const_rtx x) -{ - return VECTOR_MODE_P (GET_MODE (x)) && CONSTANT_P (x); -} - /* Return true if X is a vector constant with a duplicated element value. */ inline bool const_vec_duplicate_p (const_rtx x) { - return ((GET_CODE (x) == CONST_VECTOR - && CONST_VECTOR_NPATTERNS (x) == 1 - && CONST_VECTOR_DUPLICATE_P (x)) - || (GET_CODE (x) == CONST - && GET_CODE (XEXP (x, 0)) == VEC_DUPLICATE)); + return (GET_CODE (x) == CONST_VECTOR + && CONST_VECTOR_NPATTERNS (x) == 1 + && CONST_VECTOR_DUPLICATE_P (x)); } /* Return true if X is a vector constant with a duplicated element value. @@ -2962,20 +2952,11 @@ template <typename T> inline bool const_vec_duplicate_p (T x, T *elt) { - if (GET_CODE (x) == CONST_VECTOR - && CONST_VECTOR_NPATTERNS (x) == 1 - && CONST_VECTOR_DUPLICATE_P (x)) + if (const_vec_duplicate_p (x)) { *elt = CONST_VECTOR_ENCODED_ELT (x, 0); return true; } - if (GET_CODE (x) == CONST - && GET_CODE (XEXP (x, 0)) == VEC_DUPLICATE - && !VECTOR_MODE_P (GET_MODE (XEXP (XEXP (x, 0), 0)))) - { - *elt = XEXP (XEXP (x, 0), 0); - return true; - } return false; } @@ -3002,12 +2983,8 @@ template <typename T> inline T unwrap_const_vec_duplicate (T x) { - if (GET_CODE (x) == CONST_VECTOR - && CONST_VECTOR_NPATTERNS (x) == 1 - && CONST_VECTOR_DUPLICATE_P (x)) - return CONST_VECTOR_ENCODED_ELT (x, 0); - if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == VEC_DUPLICATE) - return XEXP (XEXP (x, 0), 0); + if (const_vec_duplicate_p (x)) + x = CONST_VECTOR_ELT (x, 0); return x; } @@ -3030,12 +3007,6 @@ const_vec_series_p (const_rtx x, rtx *base_out, rtx *step_out) && CONST_VECTOR_NPATTERNS (x) == 1 && !CONST_VECTOR_DUPLICATE_P (x)) return const_vec_series_p_1 (x, base_out, step_out); - if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == VEC_SERIES) - { - *base_out = XEXP (XEXP (x, 0), 0); - *step_out = XEXP (XEXP (x, 0), 1); - return true; - } return false; } |