This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: (subreg:SF (reg:SC)) question - 20020227-1.c failure
- From: Jan Hubicka <jh at suse dot cz>
- To: John David Anglin <dave at hiauly1 dot hia dot nrc dot ca>
- Cc: Ulrich Weigand <weigand at immd1 dot informatik dot uni-erlangen dot de>,jh at suse dot cz, gcc at gcc dot gnu dot org
- Date: Wed, 7 May 2003 00:52:17 +0200
- Subject: Re: (subreg:SF (reg:SC)) question - 20020227-1.c failure
- References: <200305061552.RAA28734@faui11.informatik.uni-erlangen.de> <200305062236.h46Mauow005042@hiauly1.hia.nrc.ca>
> Hi Ulrich,
>
> Thanks for sending the patch.
>
> > In addition to this patch, I needed to add a movstrictsf insn to
> > the s390 backend (kind of obvious ...), and also tweak it to
> > force complex values to always use at least two registers,
> > even when they would theoretically fit into a single one
> > (allowing that breaks horribly in reload for some reason I don't
> > quite understand -- something to do with subreg_offset_representable_p
> > failing ...).
>
> I've been looking at subreg_offset_representable_p. I still
> don't understand what "representable" means completely but I think
Representable means that the register is either low part, or a portion
of multi-reg value accessible via reading (possibly low part of) of one
of the registers.
> the routine is broken for big endian targets. In particular,
> this adjustment seems very strange:
>
> /* The XMODE value can be seen as an vector of NREGS_XMODE
> values. The subreg must represent an lowpart of given field.
> Compute what field it is. */
> offset -= subreg_lowpart_offset (ymode,
> mode_for_size (GET_MODE_BITSIZE (xmode)
> / nregs_xmode,
> MODE_INT, 0));
>
> When the routine is passed an offset of 0 on a big endian target, this
> results in y_offset being -1 (xmode=SCmode, ymode=SFmode). As a result,
> the routine returns false on a 64-bit target with mode_multiple = 2
> and nregs_multiple = 1.
Sorry for jumping in late, but because I wrote that function, I probably
should fix any bugs regarding that.
So you have (subreg:SF reg:SC 0) and nregs_multiple = 1, so you have
single 64bit register holding the whole SC value. Why do you think you
can access directly the upper part of it?
Honza
>
> If I change the routine so that it returns true for an offset 0
> (the high part of the SCmode value) and provide the patterns in the
> backend to handle the strict_low_part subreg insns, then things seem
> to work with a single register.
>
> Dave
> --
> J. David Anglin dave.anglin@nrc-cnrc.gc.ca
> National Research Council of Canada (613) 990-0752 (FAX: 952-6602)