diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2021-06-13 21:50:51 +0200 |
---|---|---|
committer | Uros Bizjak <ubizjak@gmail.com> | 2021-06-13 21:51:33 +0200 |
commit | 681143b9b94d7f1c88a7c34e2250865c31191959 (patch) | |
tree | 4c3d627eb89a90aee4748e2d48f8ed92664992e5 /gcc | |
parent | 291cd193f8ddb4e136ebc8f1178d35fa575b3c5d (diff) | |
download | gcc-681143b9b94d7f1c88a7c34e2250865c31191959.zip gcc-681143b9b94d7f1c88a7c34e2250865c31191959.tar.gz gcc-681143b9b94d7f1c88a7c34e2250865c31191959.tar.bz2 |
i386: Improve variable permutation insn avoidance [PR101021]
Emit constant permutation insn directly from expand_vec_perm_shufb.
2021-06-13 Uroš Bizjak <ubizjak@gmail.com>
gcc/
PR target/101021
* config/i386/i386-expand.c (expand_vec_perm_pshufb):
Emit constant permutation insn directly from here.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/i386/i386-expand.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c index 2fa3a18..6e33f6f 100644 --- a/gcc/config/i386/i386-expand.c +++ b/gcc/config/i386/i386-expand.c @@ -17593,13 +17593,16 @@ expand_vec_perm_pshufb (struct expand_vec_perm_d *d) return false; } - /* Try to avoid variable permutation instruction. */ - if (canonicalize_vector_int_perm (d, &nd) && expand_vec_perm_1 (&nd)) - return false; - if (d->testing_p) return true; + /* Try to avoid variable permutation instruction. */ + if (canonicalize_vector_int_perm (d, &nd) && expand_vec_perm_1 (&nd)) + { + emit_move_insn (d->target, gen_lowpart (d->vmode, nd.target)); + return true; + } + if (vmode == V8SImode) for (i = 0; i < 8; ++i) rperm[i] = GEN_INT ((d->perm[i * nelt / 8] * 8 / nelt) & 7); |