i386: Robustify some expanders w.r.t. paradoxical SUBREGs
commit52a6b06c26346cfb6972252ef547720b431844e6
authorUros Bizjak <ubizjak@gmail.com>
Wed, 29 Dec 2021 08:34:32 +0000 (29 09:34 +0100)
committerUros Bizjak <ubizjak@gmail.com>
Wed, 29 Dec 2021 08:35:20 +0000 (29 09:35 +0100)
tree315f544e2a7f214c3828eb155a39604bc7c1be31
parent44372676e81358de29d5c853685a7664a95d8a96
i386: Robustify some expanders w.r.t. paradoxical SUBREGs

lowpart_subreg might fail in some cases when trying to create paradoxical
SUBREGs.  Use force_reg on input operand, use new temporary output operand
and emit move into the destination afterwards.

Also, replace simplify_gen_subreg (Mx, op, My, 0)
with equivalent lowpart_subreg (Mx, op, My).

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

gcc/ChangeLog:

* config/i386/sse.md (vec_pack<floatprefix>_float_<mode>):
Perform gen_avx512dq_float<floatunssuffix>v2div2sf2 into a
pseudo and emit move insn into operands[0].
(fix<fixunssuffix>_truncv2sfv2di2): Use lowpart_subreg
instead of simplify_gen_subreg.
(trunc<mode><pmov_dst_3_lower>2): Perform
gen_avx512vl_truncate<mode>v<ssescalarnum>qi2 into a
pseudo and emit move insn into operands[0].
(trunc<mode><pmov_dst_4_lower>2): Perform
gen_avx512vl_truncate<mode>v<ssescalarnum>hi2 into a
pseudo and emit move insn into operands[0].
(truncv2div2si2): Perform gen_avx512vl_truncatev2div2si2 into a
pseudo and emit move insn into operands[0].
(truncv8div8qi2): Perform gen_avx512f_truncatev8div16qi2 into a
pseudo and emit move insn into operands[0].
(<any_extend:insn>v8qiv8hi2): Use lowpart_subreg
instead of simplify_gen_subreg.
(<any_extend:insn>v8qiv8si2): Ditto.
(<any_extend:insn>v4qiv4si2): Ditto.
(<any_extend:insn>v4hiv4si2): Ditto.
(<any_extend:insn>v8qiv8di2): Ditto.
(<any_extend:insn>v4qiv4di2): Ditto.
(<any_extend:insn>v2qiv2di2): Ditto.
(<any_extend:insn>v4hiv4di2): Ditto.
(<any_extend:insn>v2hiv2di2): Ditto.
(<any_extend:insn>v2siv2di2): Ditto.
gcc/config/i386/sse.md