diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2018-10-18 21:29:55 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2018-10-18 14:29:55 -0700 |
commit | 28dd75a330e7cc929a6be489ea3c252dd4a8bd8a (patch) | |
tree | d9b332802b405d6535065c2a11ff02798b0534dd /gcc | |
parent | 9a91ed2a2ebf5d38b9a47cb7a154592fca582e5f (diff) | |
download | gcc-28dd75a330e7cc929a6be489ea3c252dd4a8bd8a.zip gcc-28dd75a330e7cc929a6be489ea3c252dd4a8bd8a.tar.gz gcc-28dd75a330e7cc929a6be489ea3c252dd4a8bd8a.tar.bz2 |
Limit mask of vec_merge to HOST_BITS_PER_WIDE_INT
Since mask of vec_merge is in HOST_WIDE_INT, HOST_BITS_PER_WIDE_INT is
the maximum number of vector elements.
* simplify-rtx.c (simplify_subreg): Limit mask of vec_merge to
HOST_BITS_PER_WIDE_INT.
(test_vector_ops_duplicate): Likewise.
From-SVN: r265290
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/simplify-rtx.c | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e36ecd2..7c5f9dd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2018-10-18 H.J. Lu <hongjiu.lu@intel.com> + * simplify-rtx.c (simplify_subreg): Limit mask of vec_merge to + HOST_BITS_PER_WIDE_INT. + (test_vector_ops_duplicate): Likewise. + +2018-10-18 H.J. Lu <hongjiu.lu@intel.com> + PR target/72782 * config/i386/sse.md (VF_AVX512): New. (avx512bcst): Likewise. diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index ccf9216..2ff68ce 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -6611,6 +6611,7 @@ simplify_subreg (machine_mode outermode, rtx op, */ unsigned int idx; if (constant_multiple_p (byte, GET_MODE_SIZE (outermode), &idx) + && idx < HOST_BITS_PER_WIDE_INT && GET_CODE (op) == VEC_MERGE && GET_MODE_INNER (innermode) == outermode && CONST_INT_P (XEXP (op, 2)) @@ -6861,6 +6862,8 @@ test_vector_ops_duplicate (machine_mode mode, rtx scalar_reg) rtx vector_reg = make_test_reg (mode); for (unsigned HOST_WIDE_INT i = 0; i < const_nunits; i++) { + if (i >= HOST_BITS_PER_WIDE_INT) + break; rtx mask = GEN_INT ((HOST_WIDE_INT_1U << i) | (i + 1)); rtx vm = gen_rtx_VEC_MERGE (mode, duplicate, vector_reg, mask); poly_uint64 offset = i * GET_MODE_SIZE (inner_mode); |