This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/31557] New: return 0x80000000UL code gen can be improved
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Apr 2007 21:10:29 -0000
- Subject: [Bug target/31557] New: return 0x80000000UL code gen can be improved
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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