This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [trunk] Addition to subreg section of rtl.text.
- From: Kenneth Zadeck <zadeck at naturalbridge dot com>
- To: Kenneth Zadeck <zadeck at naturalbridge dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Ian Lance Taylor <iant at google dot com>, "Bonzini\, Paolo" <bonzini at gnu dot org>, rsandifo at nildram dot co dot uk
- Date: Fri, 14 Mar 2008 10:47:50 -0400
- Subject: Re: [trunk] Addition to subreg section of rtl.text.
- References: <47DA8A3E.7060002@naturalbridge.com> <87iqzpz7vj.fsf@firetop.home>
Richard Sandiford wrote:
> Kenneth Zadeck <zadeck@naturalbridge.com> writes:
>
>> Does every one agree that what i am adding is correct?
>>
>> kenny
>> Index: rtl.texi
>> ===================================================================
>> --- rtl.texi (revision 133159)
>> +++ rtl.texi (working copy)
>> @@ -1730,15 +1730,21 @@ are in @var{m}.
>> Sometimes @var{m} is wider than the mode of @var{reg}. These
>> @code{subreg} expressions are often called @dfn{paradoxical}. They are
>> used in cases where we want to refer to an object in a wider mode but do
>> -not care what value the additional bits have. The reload pass ensures
>> -that paradoxical references are only made to hard registers.
>> -
>> +not care what value the additional bits have. The smaller register
>> +always overlaps the least significant bits of the larger register and
>> +the @var{bytenum} is always zero for paradoxical registers (even on big
>> +endian machines). The reload pass ensures that paradoxical references
>> +are only made to hard registers.
>>
>
> FWIW, I agree with the first sentence. I'm not quite sure what you mean
> by the second though. My understanding is that reload should never
> replace an operand with a subreg of a hard register; it should always
> reduce it to a "reg" rtx. I think subregs should only appear after
> reload if they are part of an .md pattern (as in spe.md, for example).
>
>
Note that that sentence was already there. i added the single sentence
in the middle.
if you want to suggest new wording for that, i will be happy to add it
to my patch.
>> The other use of @code{subreg} is to extract the individual registers of
>> a multi-register value. Machine modes such as @code{DImode} and
>> @code{TImode} can indicate values longer than a word, values which
>> usually require two or more consecutive registers. To access one of the
>> registers, use a @code{subreg} with mode @code{SImode} and a
>> -@var{bytenum} offset that says which register.
>> +@var{bytenum} offset that says which register. In this case, the
>> +@var(bytenum) must align the outer value to a word boundary if the inner
>>
> ^^^^^^^^^
> Nit: {bytenum}
>
>
i will have my best people work on it.
>> +register is a psuedo or to a register boundary if the inner register is
>> +a hard register.
>>
>
> As I understand it, this is only true if the _outer_ register is
> word-sized or bigger. You can have (subreg:QI (reg:DI ...) 3) on
> a 32-bit big-endian target, for example.
>
> (I wish we didn't have subregs of hard regs, but that's a rant for
> another day. Even if we didn't have them, the rule would still
> apply when "simpilfying" a subreg whose inner register is being
> replaced by a hard register.)
>
>
I thought that this was implied since the rest of the paragraph is about
the multiword registers.
> Richard
>