]> git.ipfire.org Git - thirdparty/gcc.git/commit
Add pre_reload splitter to detect fp min/max pattern.
authorliuhongt <hongtao.liu@intel.com>
Mon, 3 Jul 2023 10:19:19 +0000 (18:19 +0800)
committerliuhongt <hongtao.liu@intel.com>
Mon, 10 Jul 2023 01:06:24 +0000 (09:06 +0800)
commitd41a57c46df6f8f7dae0c0a8b349e734806a837b
treeed9ee22f29d6bef05e99bc4e64a63a820132d982
parent361a6fc4bc5d3073e8e19fba0af51380720e677a
Add pre_reload splitter to detect fp min/max pattern.

We have ix86_expand_sse_fp_minmax to detect min/max sematics, but
it requires rtx_equal_p for cmp_op0/cmp_op1 and if_true/if_false, for
the testcase in the PR, there's an extra move from cmp_op0 to if_true,
and it failed ix86_expand_sse_fp_minmax.

This patch adds pre_reload splitter to detect the min/max pattern.

Operands order in MINSS matters for signed zero and NANs, since the
instruction always returns second operand when any operand is NAN or
both operands are zero.

gcc/ChangeLog:

PR target/110170
* config/i386/i386.md (*ieee_max<mode>3_1): New pre_reload
splitter to detect fp max pattern.
(*ieee_min<mode>3_1): Ditto, but for fp min pattern.

gcc/testsuite/ChangeLog:

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