diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-11-01 10:37:03 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-11-01 10:37:03 +0000 |
commit | 06ec586d2c384ba016c784de3279f3770d9f399d (patch) | |
tree | fa771154bb36a0e333d0f1ec22f6a13d31021200 /gcc/common.md | |
parent | 9b1de7e2e8e99eabf2b8d1ef74eb57fbd41bc730 (diff) | |
download | gcc-06ec586d2c384ba016c784de3279f3770d9f399d.zip gcc-06ec586d2c384ba016c784de3279f3770d9f399d.tar.gz gcc-06ec586d2c384ba016c784de3279f3770d9f399d.tar.bz2 |
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.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r254296
Diffstat (limited to 'gcc/common.md')
-rw-r--r-- | gcc/common.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/common.md b/gcc/common.md index dd28a7b..22c010f 100644 --- a/gcc/common.md +++ b/gcc/common.md @@ -80,14 +80,14 @@ (define_constraint "E" "Matches a floating-point constant." (ior (match_test "CONST_DOUBLE_AS_FLOAT_P (op)") - (match_test "GET_CODE (op) == CONST_VECTOR + (match_test "CONSTANT_P (op) && GET_MODE_CLASS (GET_MODE (op)) == MODE_VECTOR_FLOAT"))) ;; There is no longer a distinction between "E" and "F". (define_constraint "F" "Matches a floating-point constant." (ior (match_test "CONST_DOUBLE_AS_FLOAT_P (op)") - (match_test "GET_CODE (op) == CONST_VECTOR + (match_test "CONSTANT_P (op) && GET_MODE_CLASS (GET_MODE (op)) == MODE_VECTOR_FLOAT"))) (define_constraint "X" |