public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/106550] New: [rs6000] sub-optimal constant generation
@ 2022-08-08  2:34 guojiufu at gcc dot gnu.org
  2022-08-08  2:58 ` [Bug target/106550] [rs6000] sub-optimal 64bit constant generation for P10 linkw at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: guojiufu at gcc dot gnu.org @ 2022-08-08  2:34 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106550
           Summary: [rs6000] sub-optimal constant generation
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: guojiufu at gcc dot gnu.org
  Target Milestone: ---

There is 'pli' which supports a 34bits immediate, so to generate a 64bits
constant we just need 3 instructions at most.

void
foo (unsigned long long *a)
{
  *a = 0x020805006106003;
}

On the trunk, below asm is generated:

        .file   "test.c"
        .machine power10
        .abiversion 2
        .section        ".text"
        .align 2
        .p2align 4,,15
        .globl foo
        .type   foo, @function
foo:
.LFB0:
        .cfi_startproc
        .localentry     foo,1
        lis 9,0x20
        ori 9,9,0x8050
        sldi 9,9,32
        oris 9,9,0x610
        ori 9,9,0x6003
        std 9,0(3)
        blr
        .long 0
        .byte 0,0,0,0,0,0,0,0
        .cfi_endproc
.LFE0:
        .size   foo,.-foo
        .ident  "GCC: (GNU) 13.0.0 20220729 (experimental)"
        .section        .note.GNU-stack,"",@progbits


The compiling command: gcc -O2 -std=c99 test.c -S -mcpu=power10

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-09-15  7:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-08  2:34 [Bug target/106550] New: [rs6000] sub-optimal constant generation guojiufu at gcc dot gnu.org
2022-08-08  2:58 ` [Bug target/106550] [rs6000] sub-optimal 64bit constant generation for P10 linkw at gcc dot gnu.org
2022-08-08  3:01 ` guojiufu at gcc dot gnu.org
2022-09-15  6:20 ` cvs-commit at gcc dot gnu.org
2022-09-15  7:31 ` guojiufu at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).