This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/31557] New: return 0x80000000UL code gen can be improved


Testcase:
unsigned int f(void)
{
  return 0x80000001UL;
}

This should be able to done in three instructions:
.f:
        li 3,1
        oris 3,3,0x8000
        blr

Right now it is done as:
.L.f:
        li 3,0
        ori 3,3,32768
        sldi 3,3,16
        ori 3,3,1
        blr
Which is (0x8000 << 16) | 1 but (0x8000 << 16) is what is done for oris.


-- 
           Summary: return 0x80000000UL code gen can be improved
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
GCC target triplet: powerpc64-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31557


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]