This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: subreg rtl documentation
- From: Jim Wilson <wilson at tuliptree dot org>
- To: Kenneth Zadeck <zadeck at naturalbridge dot com>
- Cc: Jeff Law <law at redhat dot com>, Kenneth dot Zadeck at naturalbridge dot com, gcc-patches at gcc dot gnu dot org, "Bonzini, Paolo" <bonzini at gnu dot org>, Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>, Bernd Schmidt <bernds_cb1 at t-online dot de>, "Joseph S. Myers" <joseph at codesourcery dot com>, Joern Rennecke <joernr at arc dot com>, rsandifo at nildram dot co dot uk
- Date: Fri, 11 Apr 2008 09:56:21 -0700
- Subject: Re: subreg rtl documentation
- References: <87wsnda8bu.fsf@moria.site> <87ej9l8tad.fsf@firetop.home> <47FA40CC.5070503@naturalbridge.com> <87skxxabop.fsf@firetop.home> <47FA61D3.70504@tuliptree.org> <47FA6A4E.4090208@naturalbridge.com> <47FA6D0F.10703@redhat.com> <47FADCDB.90506@naturalbridge.com> <87ej9gzs13.fsf@firetop.home> <47FB970D.1080706@redhat.com> <1207672710.3224.11.camel@localhost.localdomain> <47FBA1C0.7060605@redhat.com> <47FBAE46.5040304@naturalbridge.com>
On Tue, 2008-04-08 at 13:41 -0400, Kenneth Zadeck wrote:
> You would think that you and jim were mortgage company executives
> testifying in front of congress. There is not a definitive statement here.
My answer here is the same as Jeff's. I would like to give good
answers, but can't, because these things were never defined well enough.
That is why I suggested adding some enable-checking code to verify that
all subregs are following the rules.
> Unlike paradoxical subregs of regs, paradoxical subregs of mem MAY have
> their high order bits defined. The macro LOAD_EXTEND_OP controls how
> these bits are defined when the subreg is created. The macros
> SUBREG_PROMOTED_UNSIGNED_P and SUBREG_PROMOTED_VAR_P can be queried to
> discover the meaning of these bits and the meaning can be modified by
> SUBREG_PROMOTED_UNSIGNED_SET.
You are mixing two concepts here. SUBREG_PROMOTED_* are used by the
PROMOTE_MODE macro, and have nothing to do with subregs of mem. They
are only used for subregs of regs, and only used for local variable
pseudo-regs, and maybe parameter pseudo-regs too, I don't remember. The
idea here is that if the user says
short foo;
on a 64-bit machine, we would much rather allocate and manipulate a
64-bit DImode reg than a 16-bit reg, particular since the machine
probably doesn't have any 16-bit arithmetic instructions. So we
generate (SUBREG:DI (reg:HI X)) and mark the subreg as being "special".
Jim