diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-24 10:45:52 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-24 10:45:52 +0000 |
commit | 7e436644adab6979563e1388d0ac8ded2ec1d39f (patch) | |
tree | 64cec4dd60c911068b6646624ee5ba614d073759 /gcc/optabs.c | |
parent | 57cbac18a7190903d338b17262f82890fd8bb581 (diff) |
PR target/68483
* tree-vect-generic.c (lower_vec_perm): If VEC_PERM_EXPR
is valid vec_shr pattern, don't lower it even if can_vec_perm_p
returns false.
* optabs.c (shift_amt_for_vec_perm_mask): Return NULL_RTX
whenever first is nelt or above. Don't mask expected with
2 * nelt - 1.
* gcc.target/i386/pr68483-1.c: New test.
* gcc.target/i386/pr68483-2.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230797 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r-- | gcc/optabs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c index 554530282db..40ef5829150 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -5232,12 +5232,12 @@ shift_amt_for_vec_perm_mask (rtx sel) return NULL_RTX; first = INTVAL (CONST_VECTOR_ELT (sel, 0)); - if (first >= 2*nelt) + if (first >= nelt) return NULL_RTX; for (i = 1; i < nelt; i++) { int idx = INTVAL (CONST_VECTOR_ELT (sel, i)); - unsigned int expected = (i + first) & (2 * nelt - 1); + unsigned int expected = i + first; /* Indices into the second vector are all equivalent. */ if (idx < 0 || (MIN (nelt, (unsigned) idx) != MIN (nelt, expected))) return NULL_RTX; |