This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: SUBREG_BYTE question
On Tue, Feb 26, 2002 at 01:35:35PM +0000, Bernd Schmidt wrote:
> I need to know the exact meaning of the SUBREG_BYTE field of a SUBREG.
>
> Suppose I have a big-endian target, an SImode (which is the word size)
> register, and I want to use the part of the register in a narrower mode.
> Should SUBREG_BYTE be zero, or should it be equal to the offset that
> would be used if the value were in memory?
>
> The problem I have is that I've got two testcases, and in one of these I
> get (subreg:HI (reg:SI xyz) 0) for the lowpart, and in the other I get
> (subreg:QI (reg:SI abc) 3). Fixing one breaks the other. Which one is
> correct?
(subreg:QI (reg:SI abc) 3) is correct.
On big-endian, (subreg:HI (reg:SI xyz) 0) means upper 16 bits of
32 bit register xyz.
Jakub