diff options
author | Jakub Jelinek <jakub@redhat.com> | 2019-07-30 09:13:04 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-07-30 09:13:04 +0200 |
commit | fa2987ed8db073b9d59688363e2dfb6c60f47d70 (patch) | |
tree | bdae53051778481f8c651e293ee50f84cfc142e3 /gcc/config | |
parent | b867820937a15b28e063aeec2706e31587f9eaf4 (diff) | |
download | gcc-fa2987ed8db073b9d59688363e2dfb6c60f47d70.zip gcc-fa2987ed8db073b9d59688363e2dfb6c60f47d70.tar.gz gcc-fa2987ed8db073b9d59688363e2dfb6c60f47d70.tar.bz2 |
re PR target/91150 (wrong code with -O -mavx512vbmi due to wrong writemask)
PR target/91150
* config/i386/i386-expand.c (expand_vec_perm_blend): Change mask type
from unsigned to unsigned HOST_WIDE_INT. For E_V64QImode cast
comparison to unsigned HOST_WIDE_INT before shifting it left.
* gcc.target/i386/avx512bw-pr91150.c: New test.
From-SVN: r273897
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/i386/i386-expand.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c index d50e21e..7e12a86 100644 --- a/gcc/config/i386/i386-expand.c +++ b/gcc/config/i386/i386-expand.c @@ -16385,7 +16385,8 @@ static bool expand_vec_perm_blend (struct expand_vec_perm_d *d) { machine_mode mmode, vmode = d->vmode; - unsigned i, mask, nelt = d->nelt; + unsigned i, nelt = d->nelt; + unsigned HOST_WIDE_INT mask; rtx target, op0, op1, maskop, x; rtx rperm[32], vperm; @@ -16439,7 +16440,7 @@ expand_vec_perm_blend (struct expand_vec_perm_d *d) case E_V16SImode: case E_V8DImode: for (i = 0; i < nelt; ++i) - mask |= (d->perm[i] >= nelt) << i; + mask |= ((unsigned HOST_WIDE_INT) (d->perm[i] >= nelt)) << i; break; case E_V2DImode: |