public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "munroesj at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/100085] New: Bad code for union transfer from __float128 to vector types
Date: Wed, 14 Apr 2021 18:19:50 +0000	[thread overview]
Message-ID: <bug-100085-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 100085
           Summary: Bad code for union transfer from __float128 to vector
                    types
           Product: gcc
           Version: 10.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: munroesj at gcc dot gnu.org
  Target Milestone: ---

Created attachment 50595
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50595&action=edit
Reduced example of union and __float128 to vector transfer.

GCC 10/9/8/7 will generate poor (-mcpu=power8) code when using a union to
transfer a __float128 scalar to any vector type. __float128 is a scalar type
and not typecast compatible with any vector type. Despite both being in Vector
registers. 

But for runtime codes implementing __float128 operations for -mcpu=power8 it is
useful (and faster) to perform some (data_class, conversions, etc) operations
directly in vector registers. The only solution for this is to use union to
transfer values between __float128/vector types. This should be a simple vector
register transfer and optimized as such.

But when for GCC and PowerPCle and -mcpu=power8, we are consistently seeing
store/reload sequences. For Power8 this can cause load-hit-store and pipe-line
rejects (33 cycles).

We don't see this when targeting -mcpu=power9, but power9 supports hardware
Float128 instruction. Also we don't see this when targeting BE.

             reply	other threads:[~2021-04-14 18:19 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-14 18:19 munroesj at gcc dot gnu.org [this message]
2021-04-14 18:22 ` [Bug rtl-optimization/100085] " munroesj at gcc dot gnu.org
2021-04-15  6:59 ` [Bug target/100085] " rguenth at gcc dot gnu.org
2021-04-15 18:41 ` segher at gcc dot gnu.org
2021-04-16 20:30 ` munroesj at gcc dot gnu.org
2021-04-29 15:04 ` munroesj at gcc dot gnu.org
2021-04-30 19:52 ` bergner at gcc dot gnu.org
2021-05-24  6:41 ` luoxhu at gcc dot gnu.org
2021-05-24 21:49 ` segher at gcc dot gnu.org
2021-06-02  8:27 ` luoxhu at gcc dot gnu.org
2021-06-09  5:13 ` luoxhu at gcc dot gnu.org
2021-06-09 21:35 ` bergner at gcc dot gnu.org
2021-06-09 22:08 ` segher at gcc dot gnu.org
2021-06-10 15:00 ` munroesj at gcc dot gnu.org
2021-06-11 20:28 ` segher at gcc dot gnu.org
2022-01-14 17:17 ` wschmidt at gcc dot gnu.org
2022-02-24 20:48 ` munroesj at gcc dot gnu.org
2022-02-24 20:53 ` munroesj at gcc dot gnu.org
2022-02-24 21:17 ` segher at gcc dot gnu.org
2022-02-24 21:22 ` segher at gcc dot gnu.org
2022-02-24 21:26 ` segher at gcc dot gnu.org
2022-02-25 15:31 ` munroesj at gcc dot gnu.org
2022-02-25 22:57 ` segher at gcc dot gnu.org
2022-02-26 16:22 ` munroesj 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-100085-4@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).