This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Abstracting pointer arithmetic
- To: Lars Brinkhoff <lars at nocrew dot org>
- Subject: Re: Abstracting pointer arithmetic
- From: Michael Meissner <meissner at cygnus dot com>
- Date: Mon, 29 Jan 2001 12:42:30 -0500
- Cc: gcc at gcc dot gnu dot org
- References: <85wvbe7ivi.fsf@junk.nocrew.org>
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