i386: Improve [QH]Imode rotates with masked shift count [PR99405]
authorJakub Jelinek <jakub@redhat.com>
Tue, 27 Apr 2021 08:17:45 +0000 (10:17 +0200)
committerJakub Jelinek <jakub@redhat.com>
Tue, 27 Apr 2021 08:17:45 +0000 (10:17 +0200)
commit71c8aaf29bb122ebe5e67c84903fd23ff05f04ec
tree245df97b124278d528317374b2229c502efe67e6
parent7d6bb80931b429631f63e0fd27bee95f32eb57a9
i386: Improve [QH]Imode rotates with masked shift count [PR99405]

The following testcase shows that while we nicely optimize away the
useless and? of shift count before rotation for [SD]Imode rotates,
we don't do that for [QH]Imode.

The following patch optimizes that by using the right iterator on those
4 patterns.

2021-04-27  Jakub Jelinek  <jakub@redhat.com>

PR target/99405
* config/i386/i386.md (*<insn><mode>3_mask, *<insn><mode>3_mask_1):
For any_rotate define_insn_split and following splitters, use
SWI iterator instead of SWI48.

* gcc.target/i386/pr99405.c: New test.
gcc/config/i386/i386.md
gcc/testsuite/gcc.target/i386/pr99405.c [new file with mode: 0644]