From: Alan Modra <amodra@gmail.com>
To: David Edelsohn <dje.gcc@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [RS6000] Fix PR61098, Poor code setting count register
Date: Fri, 09 May 2014 02:41:00 -0000 [thread overview]
Message-ID: <20140509024054.GE5162@bubble.grove.modra.org> (raw)
In-Reply-To: <CAGWvnyme6a+QLSxXwzUOxWAHWTokxZCySua_+25hUzaEVYvgPA@mail.gmail.com>
On Thu, May 08, 2014 at 09:48:35AM -0400, David Edelsohn wrote:
> The history is 32 bit HWI.
Right.
> The ChangeLog does not mention the changes to rs6000.md nor rs6000-protos.h.
Oops, added.
* config/rs6000/rs6000.md (movsi_internal1_single+1): Update
call to rs6000_emit_set_const in splitter.
(movdi_internal64+2, +3): Likewise.
* config/rs6000/rs6000-protos.h (rs6000_emit_set_const): Update
prototype.
> Please do not remove all of the comments from the two functions. The
> comments should provide some documentation about the different
> purposes of the two functions other than setting DEST to a CONST.
I believe my updated comment covers the complete purpose of the
function nowadays. The comments I removed are out-dated, and should
have been removed a long time ago.. rs6000_emit_set_const does not
even look at N, it always returns a non-zero result, and the return is
only tested for non-zero. I removed MODE too, because that is always
the same as GET_MODE (dest).
> Why did you remove the test for NULL dest?
>
> - if (dest == NULL)
> - dest = gen_reg_rtx (mode);
>
> That could occur, at least it used to occur.
I'm sure we can't get a NULL dest nowadays. All (three) uses of
rs6000_emit_set_const occur in splitters. They all must have passed a
gpc_reg_operand constraint on operands[0] before calling
rs6000_emit_set_const, so if NULL were possible we'd segfault in
gpc_reg_operand.
> I think that the way you rearranged the invocations of copy_rtx() in
> rs6000_emit_set_long_const() is okay, but it would be good for someone
> else to double check.
Yeah, that function is a bit messy. I took the approach of always use
a bare "dest" once in the last instruction emitted, with every other
use getting hit with copy_rtx. The previous approach was similar,
but used the bare "dest" on the first instruction emitted. Obviously
you don't need copy_rtx anywhere with the new code when
can_create_pseudo_p is true, but I felt it wasn't worth optimising
that for the added source complication.
--
Alan Modra
Australia Development Lab, IBM
next prev parent reply other threads:[~2014-05-09 2:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-08 1:49 Alan Modra
2014-05-08 13:48 ` David Edelsohn
2014-05-09 2:41 ` Alan Modra [this message]
2014-05-11 2:24 ` David Edelsohn
2014-05-11 22:53 ` Alan Modra
2014-05-11 23:39 ` Alan Modra
2014-05-14 3:05 ` Alan Modra
2014-05-14 3:46 ` David Edelsohn
2014-05-14 9:56 ` Alan Modra
2014-05-14 21:27 ` David Edelsohn
2014-05-23 15:23 ` Alan Modra
2014-05-24 16:26 ` David Edelsohn
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=20140509024054.GE5162@bubble.grove.modra.org \
--to=amodra@gmail.com \
--cc=dje.gcc@gmail.com \
--cc=gcc-patches@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).