i386: Fix <sse2p4_1>_pinsr<ssemodesuffix> and its splitters [PR103772]
commit72c68d7ad90221075102f08f22256d0b4a7631b3
authorUros Bizjak <ubizjak@gmail.com>
Mon, 20 Dec 2021 20:15:50 +0000 (20 21:15 +0100)
committerUros Bizjak <ubizjak@gmail.com>
Mon, 20 Dec 2021 20:16:39 +0000 (20 21:16 +0100)
tree201ad2daa9fc9a829011d04b414ac16e28ad7ac9
parentab85331c58223e483c55ff0316a92265d7910e9b
i386: Fix <sse2p4_1>_pinsr<ssemodesuffix> and its splitters [PR103772]

The clever trick to duplicate the value of the input operand into itself
proved not so clever after all.  The splitter should not clobber the input
operand in any case, since the register can hold the value outside the HImode
lowpart when accessed as subreg.  Use the standard earlyclobber approach
instead.

The testcase fails with avx2 ISA, but I was not able to create the testcase
that wouldn't require -mavx512fp16 compile flag.

2021-12-20  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:

PR target/103772
* config/i386/sse.md (<sse2p4_1>_pinsr<ssemodesuffix>): Add
earlyclobber to (x,x,x,i) alternative.
(<sse2p4_1>_pinsr<ssemodesuffix> peephole2): Remove.
(<sse2p4_1>_pinsr<ssemodesuffix> splitter): Use output
operand as a temporary register.  Split after reload_completed.
gcc/config/i386/sse.md