i386: Fix handling of SUBREGs in divv2sf3 [PR103842]
authorJakub Jelinek <jakub@redhat.com>
Tue, 28 Dec 2021 09:58:43 +0000 (10:58 +0100)
committerJakub Jelinek <jakub@redhat.com>
Tue, 28 Dec 2021 09:58:43 +0000 (10:58 +0100)
commit242783c52c22ed96eae722b2fa9847711ac84699
treeabe462b5c634f297590c066b2bfdf180021e898c
parent472568f5d89eddbfcaff3887dab2a6c4c7fb8d84
i386: Fix handling of SUBREGs in divv2sf3 [PR103842]

register_operand predicate allows not just REGs, but also SUBREGs of REGs,
and for the latter lowpart_subreg might FAIL when trying to create paradoxical
SUBREG in some cases.  For the input operand fixed by force_reg on it first,
for the output operand handled by always dividing into a fresh V4SFmode temporary
and emit_move_insn into the destination afterwards, that is also beneficial for
combine.

2021-12-28  Jakub Jelinek  <jakub@redhat.com>

PR target/103842
* config/i386/mmx.md (divv2sf3): Use force_reg on op1.  Always perform
divv4sf3 into a pseudo and emit_move_insn into operands[0].

* g++.dg/opt/pr103842.C: New test.
gcc/config/i386/mmx.md
gcc/testsuite/g++.dg/opt/pr103842.C [new file with mode: 0644]