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]

Re: [PATCH] New style SUBREGs, PLEASE PLEASE testme


   Date: Wed, 07 Oct 1998 11:07:22 +1300
   From: Bill Currie <bcurrie@tssc.co.nz>

   ??? (mild confusion) I think what you're saying is that I will
   still have to sort out a reliable (and preferably future proof) way
   of convincing gcc that even though DI mode pseudos are big-endian
   in memory, they are little-endian in hard-regs (ie, in a pair of
   registers, say %r2 and %r3, %r2 is ALWAYS the least significant
   word, even though mem addr 0 is the MSW and 4 is the LSW), or is
   there something hidden that I can use?  When I ported my hacks from
   gcc 2.[78].x I used ALTER_HARD_SUBREG and things seemed to work
   (though I had other problems with things like long long constants,
   bad constraints I think), but I had to hack reload so it wouldn't
   strip SUBREGs when the SUBREG number was 0.

Yes, my patches were not designed to fix this problem :-(

But thanks for making me aware of this.  I believe the problem can be
solved by the introduction of a new target macro and some mild changes
to use it properly here and there.  My initial thought is to introduce
something like "HARD_REGS_BIG_ENDIAN", then when the compiler wants to
transform subregs in various ways it can check for
HARD_REGS_BIG_ENDIAN being different from WORDS_BIG_ENDIAN and act
appropriately.  I hope you get the idea.

I have all subreg usage of the compiler pretty solid in my brain at
this moment.  If you send me a good description of how all of this
works for you (in private email please) I promise to work on a
solution so that your hacks are no longer needed.  Actually, I should
because I'll be reponsible for removing the ALTER_HARD_SUBREG
mechanism when my changes are installed :-)

Later,
David S. Miller
davem@dm.cobaltmicro.com


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