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 regression/16457] New: PowerPC - Combine two rldicr instructions into a single rlwinm.


Description:
A non-optimal code sequence is illustrated.  Two rlidcr instructions could
be replaced by a single rlwinm.  Duplicate using gcc 3.5 and command line:

gcc -O3 -m64 -c test.c

Testcase:
char *q;

void foo (char *p) {
  unsigned int x;
  q = p - (x & ~1);
}

Assembly:
      rldicr 0,0,32,31
      ld 9,.LC0@toc(2)
      rldicr 0,0,32,62
      subf 3,0,3
      std 3,0(9)
      blr

  The two rldicr instructions can be combined into one rlwinm
  with the resulting code looking like this:

      ld 9,.LC0@toc(2)
     rlwinm 0,0,0,0,30
     subf 3,0,3
     std 3,0(9)
     blr



-- 
           Summary: PowerPC - Combine two rldicr instructions into a single
                    rlwinm.
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P1
         Component: regression
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: steinmtz at us dot ibm dot com
                CC: gcc-bugs at gcc dot gnu dot org,steinmtz at us dot ibm
                    dot com
 GCC build triplet: powerpc64-linux
  GCC host triplet: powerpc64-linux
GCC target triplet: powerpc64-linux


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


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