public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "guojiufu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/63281] powerpc64le creates 64 bit constants from scratch instead of loading them
Date: Fri, 31 Dec 2021 02:00:28 +0000	[thread overview]
Message-ID: <bug-63281-4-l0Rug04Lli@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-63281-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #17 from Jiu Fu Guo <guojiufu at gcc dot gnu.org> ---
One thing, I'm wondering, is if it is really 'slow' using instructions to build
the const (even with 5 insns). 

For example, there seems no big difference in runtime between the below two
pieces of code on a real machine.
1.

foo:
.LFB0:
        .cfi_startproc
        std %r31,-8(%r1)
        .cfi_offset 31, -8
        li %r12,2
        li %r31,1
        li %r0,3
        li %r11,4
        std %r31,0(%r3)
        std %r12,0(%r4)
        std %r0,0(%r5)
        std %r11,0(%r6)
        std %r31,0(%r7)
        std %r12,0(%r8)
        ld %r31,-8(%r1)
        std %r0,0(%r9)
        std %r11,0(%r10)
        .cfi_restore 31
        blr


2
foo:
.LFB0:
        .cfi_startproc
        std 31,-8(1)
        .cfi_offset 31, -8
        li 11,0
        li 31,0
        li 12,0
        ori 11,11,0x8000
        ori 31,31,0x8000
        ori 12,12,0x8000
        sldi 11,11,32
        sldi 31,31,32
        sldi 12,12,32
        oris 11,11,0x410
        oris 31,31,0x410
        oris 12,12,0x410
        ori 11,11,0x1
        ori 31,31,0x3
        ori 12,12,0x5
        li 0,0
        std 11,0(3)
        std 31,0(4)
        li 3,0
        li 4,0
        std 12,0(5)
        li 5,0
        ori 0,0,0x8000
        ld 31,-8(1)
        ori 3,3,0x8000
        ori 4,4,0x8000
        ori 5,5,0x8000
        sldi 0,0,32
        sldi 3,3,32
        sldi 4,4,32
        sldi 5,5,32
        oris 0,0,0x410
        oris 3,3,0x410
        oris 4,4,0x410
        oris 5,5,0x410
        ori 0,0,0x7
        addi 11,11,5
        ori 3,3,0xa
        ori 4,4,0xe
        ori 5,5,0xc
        std 0,0(6)
        std 11,0(7)
        std 3,0(8)
        std 4,0(9)
        std 5,0(10)
        .cfi_restore 31
       blr

  parent reply	other threads:[~2021-12-31  2:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-16 23:01 [Bug target/63281] New: " anton at samba dot org
2014-09-17  6:32 ` [Bug target/63281] " amodra at gmail dot com
2014-09-17  6:40 ` amodra at gmail dot com
2021-12-21  9:23 ` [Bug rtl-optimization/63281] " guojiufu at gcc dot gnu.org
2021-12-21 11:09 ` guojiufu at gcc dot gnu.org
2021-12-21 14:29 ` segher at gcc dot gnu.org
2021-12-21 14:36 ` segher at gcc dot gnu.org
2021-12-30  3:29 ` guojiufu at gcc dot gnu.org
2021-12-30  7:14 ` amodra at gmail dot com
2021-12-31  1:51 ` guojiufu at gcc dot gnu.org
2021-12-31  2:00 ` guojiufu at gcc dot gnu.org [this message]
2021-12-31  7:33 ` segher at gcc dot gnu.org
2022-01-04  6:07 ` guojiufu at gcc dot gnu.org
2022-01-04  8:06 ` guojiufu at gcc dot gnu.org
2022-01-06 10:06 ` guojiufu at gcc dot gnu.org
2022-01-10  6:52 ` guojiufu at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-63281-4-l0Rug04Lli@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).