i386: Fix up *avx_vperm_broadcast_v4df [PR93430]
authorJakub Jelinek <jakub@redhat.com>
Sun, 26 Jan 2020 11:10:48 +0000 (12:10 +0100)
committerJakub Jelinek <jakub@redhat.com>
Sun, 26 Jan 2020 11:10:48 +0000 (12:10 +0100)
commit322db86f4b4df1261308e8a02e69018d9cea98e9
treed5b27a45c12cb46dc523bd244e458689bfeea41d
parentda11ffbba8741e085095f49037860de8e8701a1f
i386: Fix up *avx_vperm_broadcast_v4df [PR93430]

Apparently my recent patch which moved the *avx_vperm_broadcast* and
*vpermil* patterns before vpermpd broke the following testcase, the
define_insn_and_split matched always but the splitter condition only split
it if not -mavx2 for V4DFmode, basically relying on the vpermpd pattern to
come first.

The following patch fixes it by moving that part of SPLIT-CONDITION into
CONDITION, so that when it is not met, we just don't match the pattern
and thus match the later vpermpd pattern in that case.
Except, for { 0, 0, 0, 0 } permutation, there is actually no reason to do
that, vbroadcastsd from memory seems to be slightly cheaper than vpermpd $0.

2020-01-26  Jakub Jelinek  <jakub@redhat.com>

PR target/93430
* config/i386/sse.md (*avx_vperm_broadcast_<mode>): Disallow for
TARGET_AVX2 and V4DFmode not in the split condition, but in the
pattern condition, though allow { 0, 0, 0, 0 } broadcast always.

* gcc.dg/pr93430.c: New test.
* gcc.target/i386/avx2-pr93430.c: New test.
gcc/ChangeLog
gcc/config/i386/sse.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr93430.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx2-pr93430.c [new file with mode: 0644]