optimization/10588: [PPC] i==0||j==0 should use cntlzw and swrawi

pinskia@physics.uc.edu pinskia@physics.uc.edu
Thu May 1 21:06:00 GMT 2003


>Number:         10588
>Category:       optimization
>Synopsis:       [PPC] i==0||j==0 should use cntlzw and swrawi
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          pessimizes-code
>Submitter-Id:   net
>Arrival-Date:   Thu May 01 21:06:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Pinski
>Release:        all (3.4)
>Organization:
>Environment:
ppc-darwin6.5
>Description:
compile:
int h(int i, int j)
{
 return i==0||j==0;
}
you get currently:
_h:
        subfic r0,r3,0
        adde r2,r0,r3
        subfic r0,r4,0
        adde r5,r0,r4
        or r3,r2,r5
        blr
I would like gcc to produce:
_h:
        cntlzw r5,r3
        cntlzw r2,r4
        or r0,r2,r5
        srwi r3,r0,5
        blr
Which is smaller and faster.

Note this will speed up gcc.
>How-To-Repeat:
see description.
>Fix:
When converting the trees into rtl do this translation if the backend requests it.  I tried to do it in combine but this did not work because it was replacing two rtls with two, so it rejected it.
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list