This is the mail archive of the gcc@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: Abstracting pointer arithmetic


On Mon, Jan 29, 2001 at 11:28:01AM +0100, Lars Brinkhoff wrote:
> Hello,
> 
> When this was last discussed on the GCC mailing list in September,
> there was some interest in some kind of abstraction for pointer
> arithmetic.  This would benefit GCC ports to bit- and word-addressed
> machines.
> 
> I'm ready to start working on this now.  I hope it's possible to do
> this in a way that is acceptable to the GCC community, and can be
> approved by the Streering Committee.
> 
> Since I'm not an experienced GCC developer I'm not sure how to
> proceed, but here's a suggestion:
> 
>   Back ends should define Pmode to be a mode distinct from any other
>   mode which used by the back end.  Maybe PSImode can be used for this,
>   or maybe there can be an actual Pmode.

PSImode (and PDImode) have been used in the past for some of the difficult
machines.

>   The machine description should define insns for pointer arithmetic.
>   They should be named "addsip3", "subsip3", "subpsi3", "tstp", and
>   "cmpp", or something like that.  Examples:

While this is arguably a step in the right direction, it still assumes that
there is only size for pointers, and that all pointers are the same size and
format.  If we really want GCC to deal with the difficult machines, such as
machines with word pointers, you have to allow for different sizes (which means
different modes), etc.

-- 
Michael Meissner, Red Hat, Inc.  (GCC group)
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work:	  meissner@redhat.com		phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org	fax:   +1 978-692-4482

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