public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	       richard.sandiford@arm.com
Subject: Re: [PATCH 0/5] Fix handling of word subregs of wide registers
Date: Fri, 19 Sep 2014 15:59:00 -0000	[thread overview]
Message-ID: <541C52BE.9020907@redhat.com> (raw)
In-Reply-To: <87zjdwm5td.fsf@e105548-lin.cambridge.arm.com>

On 09/19/14 01:23, Richard Sandiford wrote:
> Jeff Law <law@redhat.com> writes:
>> On 09/18/14 04:07, Richard Sandiford wrote:
>>> This series is a cleaned-up version of:
>>>
>>>       https://gcc.gnu.org/ml/gcc/2014-03/msg00163.html
>>>
>>> The underlying problem is that the semantics of subregs depend on the
>>> word size.  You can't have a subreg for byte 2 of a 4-byte word, say,
>>> but you can have a subreg for word 2 of a 4-word value (as well as lowpart
>>> subregs of that word, etc.).  This causes problems when an architecture has
>>> wider-than-word registers, since the addressability of a word can then depend
>>> on which register class is used.
>>>
>>> The register allocators need to fix up cases where a subreg turns out to
>>> be invalid for a particular class.  This is really an extension of what
>>> we need to do for CANNOT_CHANGE_MODE_CLASS.
>>>
>>> Tested on x86_64-linux-gnu, powerpc64-linux-gnu and aarch64_be-elf.
>> I thought we fixed these problems long ago with the change to subreg_byte?!?
>
> No, that was fixing something else.  (I'm just about old enough to remember
> that too!)  The problem here is that (say):
>
>      (subreg:SI (reg:DI X) 4)
>
> is independently addressable on little-endian AArch32 if X assigned
> to a GPR, but not if X is assigned to a vector register.  We need
> to allow these kinds of subreg on pseudos in order to decompose multiword
> arithmetic.  It's then up to the RA to realise that a reload would be
> needed if X were assigned to a vector register, since the upper half
> of a vector register cannot be independently accessed.
>
> Note that you could write this example even with the old word-style offsets
> and IIRC the effect would have been the same.
Maybe I've got some kind of mental block here.  I'll go back and read 
the manual first and see if that helps :-)

jeff


  reply	other threads:[~2014-09-19 15:59 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-18 10:07 Richard Sandiford
2014-09-18 10:09 ` [PATCH 1/5] Allow *_HARD_REG_SET arguments to be const Richard Sandiford
2014-09-19  6:14   ` Jeff Law
2014-09-18 10:10 ` [PATCH 2/5] Tweak subreg_get_info documentation Richard Sandiford
2014-09-19  6:16   ` Jeff Law
2014-09-18 10:13 ` [PATCH 3/5] Use simplify_subreg_regno in combine.c:subst Richard Sandiford
2014-09-19  6:17   ` Jeff Law
2014-09-18 10:25 ` [PATCH 4/5] Generalise invalid_mode_change_p Richard Sandiford
2014-09-19 17:53   ` Jeff Law
2014-09-22  7:34     ` Richard Sandiford
2014-09-22 16:29       ` Jeff Law
2014-09-18 10:26 ` [PATCH 5/5] Remove CANNOT_CHANGE_MODE_CLASS workaround in i386.c Richard Sandiford
2014-09-19 17:54   ` Jeff Law
2014-09-19  6:14 ` [PATCH 0/5] Fix handling of word subregs of wide registers Jeff Law
2014-09-19  7:24   ` Richard Sandiford
2014-09-19 15:59     ` Jeff Law [this message]
2014-09-19 17:14     ` Jeff Law
2014-09-22  7:23       ` Richard Sandiford
2014-09-22 10:49         ` Ajit Kumar Agarwal
2014-09-22 11:26           ` Richard Sandiford
2014-09-22 12:07             ` Ajit Kumar Agarwal
2014-09-22  9:00 ` Andrew Pinski
2014-09-22 11:29   ` Richard Sandiford

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=541C52BE.9020907@redhat.com \
    --to=law@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.sandiford@arm.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).