From: Nathan Froyd <froydnj@codesourcery.com>
To: Ian Lance Taylor <iant@google.com>
Cc: roy rosen <roy.1rosen@gmail.com>, gcc@gcc.gnu.org
Subject: Re: lower subreg optimization
Date: Tue, 06 Apr 2010 17:13:00 -0000 [thread overview]
Message-ID: <20100406171245.GK540@codesourcery.com> (raw)
In-Reply-To: <mcreiisr00g.fsf@dhcp-172-17-9-151.mtv.corp.google.com>
On Tue, Apr 06, 2010 at 09:58:23AM -0700, Ian Lance Taylor wrote:
> In the code the register is always accessed via a subreg, so the
> lower-subregs pass thinks that it is OK to decompose the register.
> Once it is decomposed, nothing is expected to put it back together.
>
> To fix this, you should probably look at simple_move in
> lower-subreg.c. You will want it to return NULL_RTX for a vector load
> or store. Perhaps it should check costs, or perhaps it should never
> decompose explicit vector modes.
Compiling anything that uses doubles on powerpc e500v2 produces awful
code due in part to lower-subregs (the register allocator doesn't help,
either, but that's a different story). Code that looks like:
rY:DI = r<ARG>:DI
rX:DI = rY:DI
(subreg:DF rZ:DI 0) = rX:DI
<ARG> is a hard register for argument passing; the code looks equally
awful inside of a function, too. The above gets lowered to:
1: r<Y>:SI = r<ARG>:SI
2: r<Y+1>:SI = r<ARG+1>:SI
3: (subreg:SI rX:DI 0) = r<Y>:SI
4: (subreg:SI rX:DI 4) = r<Y+1>:SI
5: (subreg:DF rZ:DI 0) = rX:DI
which usually results in two stores and a load against the stack, rather
than a single-instruction dealing entirely in registers. I realize
e500v2 is not exactly a mainstream target, but perhaps a target hook is
appropriate here? I suppose checking costs might achieve the same
thing.
-Nathan
next prev parent reply other threads:[~2010-04-06 17:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-06 9:24 roy rosen
2010-04-06 16:37 ` Jim Wilson
2010-04-08 6:16 ` roy rosen
2010-04-09 16:52 ` Jim Wilson
2010-04-06 16:58 ` Ian Lance Taylor
2010-04-06 17:13 ` Nathan Froyd [this message]
2010-04-06 17:27 ` Steven Bosscher
2010-04-06 18:55 ` Ian Lance Taylor
2010-04-06 19:05 ` Nathan Froyd
2010-04-06 19:23 ` Joseph S. Myers
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=20100406171245.GK540@codesourcery.com \
--to=froydnj@codesourcery.com \
--cc=gcc@gcc.gnu.org \
--cc=iant@google.com \
--cc=roy.1rosen@gmail.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).