https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93802

            Bug ID: 93802
           Summary: gcc generates a rlwinm/or pair instead of a single
                    rlwimi (powerpc)
           Product: gcc
           Version: 9.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: christophe.le...@c-s.fr
  Target Milestone: ---

unsigned long f(unsigned short x)
{
        return (x << 16) | x;
}



Results in:

00000000 <f>:
   0:   54 69 80 1e     rlwinm  r9,r3,16,0,15
   4:   7d 23 1b 78     or      r3,r9,r3
   8:   4e 80 00 20     blr



Should instead be:

rlwimi r3, r3, 16, 0, 15
blr

Problem seen with at least GCC 9.2 and GCC 8.1 and GCC 5.5

Reply via email to