From: Segher Boessenkool <segher@kernel.crashing.org>
To: Michael Meissner <meissner@linux.ibm.com>,
gcc-patches@gcc.gnu.org, David Edelsohn <dje.gcc@gmail.com>,
Bill Schmidt <wschmidt@linux.ibm.com>,
Peter Bergner <bergner@linux.ibm.com>,
Will Schmidt <will_schmidt@vnet.ibm.com>
Subject: Re: [PATCH] Fix SFmode subreg of DImode and TImode
Date: Tue, 7 Sep 2021 18:07:30 -0500 [thread overview]
Message-ID: <20210907230730.GM1583@gate.crashing.org> (raw)
In-Reply-To: <YTcQ5BZr4NQvH7DY@toto.the-meissners.org>
Hi!
On Tue, Sep 07, 2021 at 03:12:36AM -0400, Michael Meissner wrote:
> [PATCH] Fix SFmode subreg of DImode and TImode
>
> This patch fixes the breakage in the PowerPC due to a recent change in SUBREG
> behavior.
But what was that change? And was that intentional? If so, why wasn't
it documented, was the existing behaviour considered buggy? But the
documentation agrees with the previous behaviour afaics.
> While it is arguable that the patch that caused the breakage should
> be reverted, this patch should be a bandage to prevent these changes from
> happening again.
NAK. This patch will likely cause us to generate worse code. If that
is not the case it will need a long, in-depth explanation of why not.
Sorry.
> I first noticed it in building the Spec 2017 wrf_r and blender_r
> benchmarks. Once I applied this patch, I also noticed several of the
> tests now pass.
>
> The core of the problem is we need to treat SUBREG's of SFmode and SImode
> specially on the PowerPC. This is due to the fact that SFmode values that are
> in the vector and floating point registers are represented as DFmode. When we
> want to do a direct move between the GPR registers and the vector registers, we
> have to convert the value from the DFmode representation to/from the SFmode
> representation.
The core of the problem is that subreg of pseudos has three meanings:
-- Paradoxical subregs;
-- Actual subregs;
-- "bit_cast" thingies: treat the same bits as something else. Like
looking at the bits of a float as its memory image.
Ignoring paradoxical subregs (as well as subregs of mem, which should
have disappeared by now), and subregs of hard registers as well (those
have *different* semantics after all), the other two kinds can be mixed,
and *have to* be mixed, because subregs of subregs are non-canonical.
Is there any reason why not to allow this kind of subreg?
If we want to not allow mixing bit_cast with subregs, we should make it
its own RTL code.
> + /* In case we are given a SUBREG for a larger type, reduce it to
> + SImode. */
> + if (mode == SFmode && GET_MODE_SIZE (inner_mode) > 4)
> + {
> + rtx tmp = gen_reg_rtx (SImode);
> + emit_move_insn (tmp, gen_lowpart (SImode, source));
> + emit_insn (gen_movsf_from_si (dest, tmp));
> + return true;
> + }
This makes it two separate insns. Is that always optimised to code that
is at least as good as before?
Segher
next prev parent reply other threads:[~2021-09-07 23:08 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-07 7:12 Michael Meissner
2021-09-07 23:07 ` Segher Boessenkool [this message]
2021-09-08 6:42 ` Richard Biener
2021-09-08 17:08 ` Segher Boessenkool
2021-09-08 17:50 ` David Edelsohn
2021-09-08 18:39 ` Richard Biener
2021-09-08 19:16 ` Segher Boessenkool
2021-09-09 1:23 ` Hongtao Liu
2021-09-09 1:31 ` Hongtao Liu
2021-09-09 6:16 ` Richard Biener
2021-09-09 22:53 ` Michael Meissner
2021-09-09 23:48 ` Segher Boessenkool
2021-09-10 3:09 ` Hongtao Liu
2021-09-10 10:54 ` Richard Biener
2021-09-10 11:25 ` Hongtao Liu
2021-09-10 12:34 ` Hongtao Liu
2021-09-10 14:08 ` David Edelsohn
2021-09-10 14:14 ` Hongtao Liu
2021-09-10 15:32 ` Segher Boessenkool
2021-09-10 10:53 ` Richard Biener
2021-09-10 15:05 ` Segher Boessenkool
2021-09-13 9:03 ` Richard Biener
2021-09-08 15:31 ` Michael Meissner
2021-09-09 21:59 ` Jim Wilson
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=20210907230730.GM1583@gate.crashing.org \
--to=segher@kernel.crashing.org \
--cc=bergner@linux.ibm.com \
--cc=dje.gcc@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=meissner@linux.ibm.com \
--cc=will_schmidt@vnet.ibm.com \
--cc=wschmidt@linux.ibm.com \
/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).