This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/36557] New: -m32 -mpowerpc64 produces better code than -m64 for a!=0
- 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: 17 Jun 2008 20:11:29 -0000
- Subject: [Bug target/36557] New: -m32 -mpowerpc64 produces better code than -m64 for a!=0
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Testcase:
unsigned char f(unsigned int m_pAttachedTo)
{
return m_pAttachedTo != 0;
}
When merging the PS3 specific changes up to 4.3.0, I Noticed that -m32
-mpowerpc64 produces better code in some cases than -m64, this is one such
case.
Right now with -m64 we produce:
srawi 0,3,31
xor 3,0,3
subf 3,3,0
rldicl 3,3,33,63
blr
But since m_pAttachedTo is passed as a zero extended 64bit we should be able to
produce:
addic 9,3,-1
subfe 0,9,3
blr
As we do for -m32 and also for 64bit unsigned integers with -m64.
--
Summary: -m32 -mpowerpc64 produces better code than -m64 for a!=0
Product: gcc
Version: 4.4.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
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36557