[Bug target/94395] New: Powerpc suboptimal 64-bit constant generation near large values with few bits set

npiggin at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Mar 30 05:34:18 GMT 2020


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

            Bug ID: 94395
           Summary: Powerpc suboptimal 64-bit constant generation near
                    large values with few bits set
           Product: gcc
           Version: 9.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: npiggin at gmail dot com
  Target Milestone: ---

0xc000000000000000UL is generated with

        li 9,-1
        rldicr 9,9,0,1

0xbfffffffffffffffUL (0xc000000000000000UL - 1) is

        lis 9,0xbfff
        ori 9,9,0xffff
        sldi 9,9,32
        oris 9,9,0xffff
        ori 9,9,0xffff

Could be

        li 9,-1
        rldicr 9,9,0,1
        subi 9,9,1


More information about the Gcc-bugs mailing list