]> gcc.gnu.org Git - gcc.git/commit
[APX CCMP] Adjust startegy for selecting ccmp candidates
authorHongyu Wang <hongyu.wang@intel.com>
Tue, 9 Apr 2024 08:05:26 +0000 (16:05 +0800)
committerHongyu Wang <hongyu.wang@intel.com>
Thu, 6 Jun 2024 07:29:47 +0000 (15:29 +0800)
commit23db87301b623ecf162c9df718ce82ed9aa354a8
tree74dd3d284896e08d4597123b0389516b9508e912
parentc989e59fc99d994159114304d4e715c72bedff0a
[APX CCMP] Adjust startegy for selecting ccmp candidates

For general ccmp scenario, the tree sequence is like

_1 = (a < b)
_2 = (c < d)
_3 = _1 & _2

current ccmp expanding will try to swap compare order for _1 and _2,
compare the expansion cost/cost2 for expanding _1 or _2 first, then
return the sequence with lower cost.

It is possible that one expansion succeeds and the other fails.
For example, x86 has int ccmp but not fp ccmp, so a combined fp and
int comparison must be ordered such that the fp comparison happens
first.  The costs are not meaningful for failed expansions.

Check the expand_ccmp_next result ret and ret2, returns the valid one
before cost comparison.

gcc/ChangeLog:

* ccmp.cc (expand_ccmp_expr_1): Check ret and ret2 of
expand_ccmp_next, returns the valid one first instead of
comparing cost.
gcc/ccmp.cc
This page took 0.050963 seconds and 5 git commands to generate.