This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: subreg rtl documentation


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]